Learn R Programming

pfr (version 1.0.1)

buildModelFuncs: Build c++ particle filtering code for your R session.

Description

Build c++ particle filtering code for your R session.

Usage

buildModelFuncs(myDir, modelName, verbose = FALSE)

Value

an Rcpp Module object

Arguments

myDir

directory with your three code files (i.e. model header, model source and export code)

modelName

your model name. Must be in all lowercase, and be a substring of the above-mentioned filenames

verbose

logical and passed in to inline::cxxfunction()

Examples

Run this code
if (FALSE) {
# compile everything from scratch
svol_lev <- buildModelFuncs("~/Desktop", "svol_leverage")

# then use your model's log-likelihood and filtering functions
svol_lev$svol_leverage_bswc_approx_LL(rnorm(100), c(.9, 0.0, 1.0, -.2))
svol_lev$svol_leverage_bswc_approx_filt(rnorm(100), c(.9, 0.0, 1.0, -.2))
}

Run the code above in your browser using DataLab