Implementing a particle filter in C++ using Rcpp (part 2)

In my previous blog post I showed how to implement a particle filter in C++.

In this post I will implement a backward-simulation particle smoother (see Example 3 in the code below) and a method for forecasting with the particle filter (Example 4) in C++. By using R packages Rcpp (version 0.12.11) and RcppArmadillo (version 0.7.800.2.0) it is possible to subsequently run this smoother and forecasting method in R. Continue reading Implementing a particle filter in C++ using Rcpp (part 2)

Implementing a particle filter in C++ using Rcpp (part 1)

In one of my previous blog posts I demonstrated how to implement a particle filter in R.

In this post I’m going to implement the same particle filter, but this time I’ll program the filter in C++. The R packages Rcpp (version 0.12.11) and RcppArmadillo (version 0.7.800.2.0) will make it possible to subsequently run this filter in R, since these two R packages allow us to connect C++ to R. Continue reading Implementing a particle filter in C++ using Rcpp (part 1)

R code for forecasting with the bootstrap filter

In one of my previous blog posts I demonstrated how to implement a particle  (bootstrap) filter in R.
In this post I will demonstrate how to predict future system states and observations with the particle/bootstrap filter.

Bootstrap filter forecasting

Continue reading R code for forecasting with the bootstrap filter

R code for implementing a particle filter

The R code below implements a particle filter in R. The implemented particle filter is also referred to as the bootstrap filter.
If necessary, the implemented bootstrap filter performs resampling and/or roughening.

Similar to the Extended Kalman Filter (EKF), the Unscented Kalman Filter (UKF), the Ensemble Kalman Filter (EnKF), and the Gauss-Hermite Kalman Filter (GHKF), the bootstrap filter may be used for solving nonlinear filtering problems.

Particle filter

Continue reading R code for implementing a particle filter