Description Usage Arguments Value See Also Examples
View source: R/sde.make.model.R
Compiles the C++ code for various SDE-related algorithms and makes the routines available within R.
1 2 3 4 5 6 7 8 9 | 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:
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
.
sde.drift()
, sde.diff()
, sde.valid()
, sde.loglik()
, sde.prior()
, sde.sim()
, sde.post()
.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.