Learn R Programming

yuima (version 1.15.2)

ae: Asymptotic Expansion

Description

Asymptotic expansion of uni-dimensional and multi-dimensional diffusion processes.

Usage

ae(
  model,
  xinit,
  order = 1L,
  true.parameter = list(),
  sampling = NULL,
  eps.var = "eps",
  solver = "rk4",
  verbose = FALSE
)

Arguments

model
xinit

initial value vector of state variables.

order

integer. The asymptotic expansion order. Higher orders lead to better approximations but longer computational times.

true.parameter

named list of parameters.

sampling
eps.var

character. The perturbation variable.

solver

the solver for ordinary differential equations. One of "rk4" (more accurate) or "euler" (faster).

verbose

logical. Print on progress? Default FALSE.

Value

An object of yuima.ae-class

Details

If sampling is not provided, then model must be an object of yuima-class with non-empty sampling.

if eps.var does not appear in the model specification, then it is internally added in front of the diffusion matrix to apply the asymptotic expansion scheme.

Examples

Run this code
# NOT RUN {
# model
gbm <- setModel(drift = 'mu*x', diffusion = 'sigma*x', solve.variable = 'x')

# settings
xinit <- 100
par <- list(mu = 0.01, sigma = 0.2)
sampling <- setSampling(Initial = 0, Terminal = 1, n = 1000)

# asymptotic expansion
approx <- ae(model = gbm, sampling = sampling, order = 4, true.parameter = par, xinit = xinit)

# exact density
x <- seq(50, 200, by = 0.1)
exact <- dlnorm(x = x, meanlog = log(xinit)+(par$mu-0.5*par$sigma^2)*1, sdlog = par$sigma*sqrt(1))

# compare
plot(x, exact, type = 'l', ylab = "Density")
lines(x, aeDensity(x = x, ae = approx, order = 1), col = 2)
lines(x, aeDensity(x = x, ae = approx, order = 2), col = 3)
lines(x, aeDensity(x = x, ae = approx, order = 3), col = 4)
lines(x, aeDensity(x = x, ae = approx, order = 4), col = 5)
# }

Run the code above in your browser using DataLab