sde.examples: Example SDE models.

Description Usage Arguments Details Value See Also Examples

View source: R/sde.examples.R

Description

Provides sample C++ code for several SDE models.

Usage

1
2
3
4
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.

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").

Value

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

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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)

## End(Not run)

msde documentation built on Dec. 17, 2021, 9:07 a.m.