Learn R Programming

Sim.DiffProc (version 2.5)

Appdcon: Approximated Conditional Law a Diffusion Process

Description

Approximated Conditional densities for X(t)|X(t0)=X0 of a diffusion process.

Usage

Appdcon(x, t, x0, t0, drift, diff, Output = FALSE,
         Methods = c("Euler", "Shoji-Ozaki", "Kessler"), ...)

Arguments

x
vector of quantiles.
t
calcul at time t, or evolution in vector times.
x0
initial value of the process at time t0.
t0
initial time.
drift
drift coefficient: an expression of two variables t and x.
diff
diffusion coefficient: an expression of two variables t and x.
Output
if Output = TRUE write a Output to an Excel (.csv).
Methods
Approximated methods,see details.
...

Value

  • data.frame(time,f(x(t)|x0)) at final time, and plot of evolution conditional Law.

Details

This function returns the value of the conditional density of X(t)|X(t0)=X0 at point x.

Examples

Run this code
## Euler methods
 f <- expression(1*(1-x))
 g <- expression(0.3)
 Appdcon(x=seq(0,3,by=0.01), t = 2 , x0 = 1,t0=0, drift=f, diff=g)
## Kessler s'methods
 f <- expression(1*(3-x))
 g <- expression(x)
 Appdcon(x=seq(0,5,by=0.01), t = seq(0,0.5,by=0.001) , 
        x0 = 1,t0=0, drift=f, diff=g,Methods="Kessler")

## Shoji-Ozaki methods
 f <- expression(4*x)
 g <- expression(0.3*x)
 Appdcon(x=seq(0,3,by=0.01), t = seq(0,1.5,by=0.010) , 
         x0 = 1,t0=0, drift=f, diff=g,Methods="Shoji-Ozaki")

Run the code above in your browser using DataLab