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 implementing an Ensemble Kalman Filter

This blog post will demonstrate how to implement an Ensemble Kalman Filter (EnKF) in R.
Similar to filters such as the Extended Kalman Filter (EKF) and the Unscented Kalman Filter (UKF), the EnKF may be used for solving nonlinear filtering problems. However, the EnKF may be applied when solving nonlinear (and linear) filtering problems with a large number of states.

Ensemble Kalman Filter Continue reading R code for implementing an Ensemble Kalman Filter

R code for implementing a Gaussian sum filter

The code below implements a Gaussian sum filter (GSF) in R. The implemented GSF employs a bank of Gauss-Hermite Kalman filters (GHKF).

A GSF may be used when the process noise, measurement noise, or a posteriori state distribution is expected to follow some non-Gaussian distribution. The GSF approximates such non-Gaussian distributions with a mixture (or sum) of Gaussian distributions.

If necessary, the implemented Gaussian sum filter performs pruning as a Gaussian mixture reduction technique.

Gaussian sum filter

Continue reading R code for implementing a Gaussian sum filter