model: an object of yuima-class or yuima.model-class.
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: a yuima.sampling-class object.
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.
Returns
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
## Not run:# modelgbm <- setModel(drift ='mu*x', diffusion ='sigma*x', solve.variable ='x')# settingsxinit <-100par <- list(mu =0.01, sigma =0.2)sampling <- setSampling(Initial =0, Terminal =1, n =1000)# asymptotic expansionapprox <- ae(model = gbm, sampling = sampling, order =4, true.parameter = par, xinit = xinit)# exact densityx <- 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))# compareplot(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)## End(Not run)