Learn R Programming

Sim.DiffProc (version 2.8)

st.int: Stochastic Integrals

Description

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

Usage

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

## S3 method for class 'st.int':
summary(object, \dots)
## S3 method for class 'st.int':
time(x, \dots)
## S3 method for class 'st.int':
mean(x, \dots)
## S3 method for class 'st.int':
median(x, \dots)
## S3 method for class 'st.int':
quantile(x, \dots)
## S3 method for class 'st.int':
kurtosis(x, \dots)
## S3 method for class 'st.int':
skewness(x, \dots)
## S3 method for class 'st.int':
moment(x, order = 2, \dots)
## S3 method for class 'st.int':
bconfint(x, level=0.95, \dots)
## S3 method for class 'st.int':
plot(x, \dots)
## S3 method for class 'st.int':
lines(x, \dots)
## S3 method for class 'st.int':
points(x, \dots)

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.
subdivisions
the maximum number of subintervals.
type
Ito or Stratonovich integration.
x, object
an object inheriting from class "st.int".
order
order of moment.
level
the confidence level required.
...
further arguments for (non-default) methods.

Value

  • st.int returns an object inheriting from class "st.int".
  • Xthe final simulation of the integral, an invisible ts object.
  • funfunction to be integrated.
  • typetype of stochastic integral.
  • subdivisionsthe number of subintervals produced in the subdivision process.

newcommand

\CRANpkg

href

http://CRAN.R-project.org/package=#1

pkg

#1

Details

The function st.int returns a ts x of length N+1; i.e. simulation of stochastic integrals of Ito or Stratonovich type. The Ito 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}})$$ For more details see vignette("SDEs").

References

Ito, K. (1944). Stochastic integral. Proc. Jap. Acad, Tokyo, 20, 19--529. 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]

fexpr <- expression( exp(w-0.5*t) )
res <- st.int(fexpr,type="ito",M=10,lower=0,upper=1)
res
## res$X 
summary(res)
## Display
plot(res,plot.type="single")
lines(time(res),mean(res),col=2,lwd=2)
lines(time(res),bconfint(res,level=0.95)[,1],col=4,lwd=2)
lines(time(res),bconfint(res,level=0.95)[,2],col=4,lwd=2)
legend("topleft",c("mean path",paste("bound of", 95,"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]

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

Run the code above in your browser using DataLab