Learn R Programming

Sim.DiffProc (version 4.9)

st.int: Stochastic Integrals

Description

The (S3) generic function st.int of simulation of stochastic integrals of Itô or Stratonovich type.

Usage

st.int(expr, ...)
# S3 method for default
st.int(expr, lower = 0, upper = 1, M = 1, subdivisions = 1000L, 
               type = c("ito", "str"), ...)

# S3 method for st.int summary(object, at ,digits=NULL, ...) # S3 method for st.int time(x, ...) # S3 method for st.int mean(x, at, ...) # S3 method for st.int Median(x, at, ...) # S3 method for st.int Mode(x, at, ...) # S3 method for st.int quantile(x, at, ...) # S3 method for st.int kurtosis(x, at, ...) # S3 method for st.int min(x, at, ...) # S3 method for st.int max(x, at, ...) # S3 method for st.int skewness(x, at, ...) # S3 method for st.int moment(x, at, ...) # S3 method for st.int cv(x, at, ...) # S3 method for st.int bconfint(x, at, ...)

# S3 method for st.int plot(x, ...) # S3 method for st.int lines(x, ...) # S3 method for st.int points(x, ...)

Value

st.int returns an object inheriting from class

"st.int".

X

the final simulation of the integral, an invisible ts object.

fun

function to be integrated.

type

type of stochastic integral.

subdivisions

the number of subintervals produced in the subdivision process.

Arguments

expr

an expression of two variables t (time) and w (w: standard Brownian motion).

lower, upper

the lower and upper end points of the interval to be integrate.

M

number of trajectories (Monte-Carlo).

subdivisions

the maximum number of subintervals.

type

Itô or Stratonovich integration.

x, object

an object inheriting from class "st.int".

at

time between lower and upper. Monte-Carlo statistics of stochastic integral at time at. The default at = upper.

digits

integer, used for number formatting.

...

potentially further arguments for (non-default) methods.

Author

A.C. Guidoum, K. Boukhetala.

Details

The function st.int returns a ts x of length N+1; i.e. simulation of stochastic integrals of Itô or Stratonovich type.

The Itô interpretation is: $$\int_{t_{0}}^{t} f(s) dW_{s} = \lim_{N \rightarrow \infty} \sum_{i=1}^{N} f(t_{i-1})(W_{t_{i}}-W_{t_{i-1}})$$ The Stratonovich interpretation is: $$\int_{t_{0}}^{t} f(s) \circ dW_{s} = \lim_{N \rightarrow \infty} \sum_{i=1}^{N} f\left(\frac{t_{i}+t_{i-1}}{2}\right)(W_{t_{i}}-W_{t_{i-1}})$$

An overview of this package, see browseVignettes('Sim.DiffProc') for more informations.

References

Ito, K. (1944). Stochastic integral. Proc. Jap. Acad, Tokyo, 20, 19--529.

Stratonovich RL (1966). New Representation for Stochastic Integrals and Equations. SIAM Journal on Control, 4(2), 362--371.

Kloeden, P.E, and Platen, E. (1995). Numerical Solution of Stochastic Differential Equations. Springer-Verlag, New York.

Oksendal, B. (2000). Stochastic Differential Equations: An Introduction with Applications. 5th edn. Springer-Verlag, Berlin.

See Also

snssde1d, snssde2d and snssde3d for 1,2 and 3-dim sde.

Examples

Run this code

## Example 1: Ito integral
## f(t,w(t)) = int(exp(w(t) - 0.5*t) * dw(s)) with t in [0,1]
set.seed(1234)

f <- expression( exp(w-0.5*t) )
mod1 <- st.int(expr=f,type="ito",M=50,lower=0,upper=1)
mod1
summary(mod1)
## Display
plot(mod1)
lines(time(mod1),apply(mod1$X,1,mean),col=2,lwd=2)
lines(time(mod1),apply(mod1$X,1,bconfint,level=0.95)[1,],col=4,lwd=2)
lines(time(mod1),apply(mod1$X,1,bconfint,level=0.95)[2,],col=4,lwd=2)
legend("topleft",c("mean path",paste("bound of", 95," percent confidence")),
       inset = .01,col=c(2,4),lwd=2,cex=0.8)

## Example 2: Stratonovich integral
## f(t,w(t)) = int(w(s)  o dw(s)) with t in [0,1]
set.seed(1234)

g <- expression( w )
mod2 <- st.int(expr=g,type="str",M=50,lower=0,upper=1)
mod2
summary(mod2)
## Display
plot(mod2)
lines(time(mod2),apply(mod2$X,1,mean),col=2,lwd=2)
lines(time(mod2),apply(mod2$X,1,bconfint,level=0.95)[1,],col=4,lwd=2)
lines(time(mod2),apply(mod2$X,1,bconfint,level=0.95)[2,],col=4,lwd=2)
legend("topleft",c("mean path",paste("bound of", 95," percent confidence")),
       inset = .01,col=c(2,4),lwd=2,cex=0.8)

Run the code above in your browser using DataLab