Learn R Programming

msde (version 1.0.5)

sde.examples: Example SDE models.

Description

Provides sample C++ code for several SDE models.

Usage

sde.examples(
  model = c("hest", "pgnet", "lotvol", "biou", "eou"),
  file.only = FALSE
)

Arguments

model

Character string giving the name of a sample model. Possible values are: hest, pgnet, lotvol, biou, eou. See Details.

file.only

If TRUE returns only the path to the header file containing the sdeModel object implementation.

Value

An sde.model object, or the path to the C++ model header file.

Details

All pre-compiled models are with the default prior and with OpenMP disabled. A full description of the example models can be found in the package vignette; to view it run vignette("msde-exmodels").

See Also

sde.make.model() for sde.model objects, mvn.hyper.check() for specification of the default prior.

Examples

Run this code
# NOT RUN {
# Heston's model
hmod <- sde.examples("hest") # load pre-compiled model

# inspect model's C++ code
hfile <- sde.examples("hest", file.only = TRUE)
cat(readLines(hfile), sep = "\n")

# }
# NOT RUN {
# compile it from scratch
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)
# }

Run the code above in your browser using DataLab