pfLineartBS
function provides a simple example for
RcppSMC. It is based on the first example in SMCTC
and
the discussion in Section 5.1 of Johansen (2009). A simple 'vehicle
tracking' problem of 100 observations is solved with 1000 particles. The pfLineartBSOnlinePlot
function provides a simple default
online plotting function that is invoked during the
estimation process.
The simLineart
function simulates data from the model.
pfLineartBS(data, particles=1000, plot=FALSE, onlinePlot) pfLineartBSOnlinePlot(xm, ym) simLineart(len)
pfLineartBS
function returns a data.frame
containing as many rows as in
the input data, and four columns corresponding to the estimated $x$ and
$y$ coordinates as well as the estimated velocity in these two
directions.The simLineart
function returns a list containing the vector of
states and the associated vector of observations.
pfLineartBS
function provides a simple example for
RcppSMC. The model is linear with t-distributed innovations.
It is based on the pf
example in the
SMCTC
library, and discussed in the Section 5.1 of his
corresponding paper (Johansen, 2009). simLineart
simulates from the
model. Using the simple pfExOnlinePlot
function illustrates how
callbacks into R, for example for plotting, can be made during the
operation of SMC algorithm.
res <- pfLineartBS(plot=TRUE)
if (interactive()) ## if not running R CMD check etc
res <- pfLineartBS(onlinePlot=pfLineartBSOnlinePlot)
Run the code above in your browser using DataLab