sde.make.model {msde} | R Documentation |
Create an SDE model object.
Description
Compiles the C++ code for various SDE-related algorithms and makes the routines available within R.
Usage
sde.make.model(
ModelFile,
PriorFile = "default",
data.names,
param.names,
hyper.check,
OpenMP = FALSE,
...
)
Arguments
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 |
Value
An sde.model
object, consisting of a list with the following elements:
ptr
Pointer to C++ sde object (
sdeRobj
) 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
.
See Also
sde.drift()
, sde.diff()
, sde.valid()
, sde.loglik()
, sde.prior()
, sde.sim()
, sde.post()
.
Examples
# 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