Learn R Programming

yuima (version 1.0.81)

setFunctional: Description of a functional associated with a perturbed stochastic differential equation

Description

This function is used to give a description of the stochastic differential equation. The functional represent the price of the option in financial economics, for example.

Usage

setFunctional(model, F, f, xinit,e)

Arguments

model
yuima or yuima.model object.
F
function of $X_t$ and $epsilon$
f
list of functions of $X_t$ and $epsilon$
xinit
initial values of state variable.
e
epsilon parameter

Value

  • yuimaan object of class 'yuima' containing object of class 'functional'. If yuima object was given as 'model' argument, the result is just added and the other slots of the object are maintained.

Details

You should look at the vignette and examples.

The object foi contains several ``slots''. To see inside its structure we use the R

Examples

Run this code
set.seed(123)
# to the Black-Scholes economy:
# dXt^e = Xt^e * dt + e * Xt^e * dWt
diff.matrix <- matrix( c("x*e"), 1,1)
model <- setModel(drift = c("x"), diffusion = diff.matrix)
# call option is evaluated by averating
# max{ (1/T)*int_0^T Xt^e dt, 0}, the first argument is the functional of interest:
Terminal <- 1
xinit <- c(1)
f <- list( c(expression(x/Terminal)), c(expression(0)))
F <- 0
division <- 1000
e <- .3
yuima <- setYuima(model = model,sampling = setSampling(Terminal = Terminal, n = division))
yuima <- setFunctional( model = yuima, xinit=xinit, f=f,F=F,e=e)
# look at the model structure
str(yuima@functional)

Run the code above in your browser using DataLab