To play with particle filters/SMC efficiently it is good to install some dedicated packages. These packages require compilation of C++ code (don't worry you won't need to code in C++!). Here are some preparatory steps to make your R/Rstudio ready. 1) you need a C++ compiler installed in your computer. a) if you are a Windows user, install Rtools (download from the following page, not within Rstudio!) --> https://cran.r-project.org/bin/windows/Rtools/ Important: if you have Rtools already installed in your computer, make sure that you have one compatible with your current R version (see the page above). b) if you are a MacOS user, install Xcode from the app store (if it's not installed already) c) If you are a Linux user, most likely you have a compiler already installed (eg gcc/g++) and you won't need to do anything. Try first the next steps and if something goes wrong install gcc and g++ 2) If R/Rstudio was open while you installed the C++ compiler, close and restart R/Rstudio. 3) launch R or Rstudio and install *both* the packages 'nimble' and 'nimbleSMC' (you can install those from within Rstudio). 4) run the file demo_nimbleSMC.R that I uploaded on Canvas. Notice, the critical lines where C++ compilation happen are those invoking 'compileNimble()', that is Cmodel <- compileNimble(model) Cmy_BootF <- compileNimble(my_BootF, project = model) If running both lines produces Compiling [Note] This may take a minute. [Note] Use 'showCompilerOutput = TRUE' to see C++ compilation details. then compilation was successful. If you get errors, check the "troubleshooting" section in https://r-nimble.org/html_manual/cha-installing-nimble.html We will discuss the code at lecture. No previous experience with the packages above is assumed.