sde.make.model {msde} | R Documentation |
Compiles the C++ code for various SDE-related algorithms and makes the routines available within R.
sde.make.model(ModelFile, PriorFile = "default", data.names, param.names, hyper.check, OpenMP = FALSE, ...)
ModelFile |
Path to the header file where the SDE model is defined. |
PriorFile |
Path to the header file where the SDE prior is defined. See |
data.names |
Vector of names for the SDE components. Defaults to |
param.names |
Vector of names for the SDE parameters. Defaults to |
hyper.check |
A function with arguments |
OpenMP |
Logical; whether the model is compiled with |
... |
additional arguments to |
An sde.model
object, consisting of a list with the following elements:
model.ptr
Pointer to C++ sde object (sdeCobj
) implementing the member functions: drift/diffusion, data/parameter validators, loglikelihood, prior distribution, forward simulation, MCMC algorithm for Bayesian inference.
ndims, nparams
The number of SDE components and parameters.
data.names, param.names
The names of the SDE components and parameters.
omp
A logical flag for whether or not the model was compiled for multicore functionality with OpenMP
.
sde.drift
, sde.diff
, sde.valid
, sde.loglik
, sde.prior
, sde.sim
, sde.post
.
# header (C++) file for Heston's model hfile <- sde.examples("hest", file.only = TRUE) cat(readLines(hfile), sep = "\n") # compile the model param.names <- c("alpha", "gamma", "beta", "sigma", "rho") data.names <- c("X", "Z") hmod <- sde.make.model(ModelFile = hfile, param.names = param.names, data.names = data.names) hmod