create new Ornstein-Uhlenbeck process - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Finance : Stochastic Processes : Finance/OrnsteinUhlenbeckProcess

Finance[OrnsteinUhlenbeckProcess] - create new Ornstein-Uhlenbeck process

Calling Sequence

OrnsteinUhlenbeckProcess(x0, mu, theta, sigma, opts)

Parameters

x0

-

algebraic expression; initial value

mu

-

algebraic expression; long-running mean

theta

-

algebraic expression; the speed of mean reversion

sigma

-

algebraic expression; the volatility parameter

opts

-

(optional) equation(s) of the form option = value where option is scheme; specify options for the OrnsteinUhlenbeckProcess command

Description

• 

The OrnsteinUhlenbeckProcess command creates an Ornstein-Uhlenbeck process. This is a stochastic process Xt governed by the stochastic differential equation (SDE)

dXt=θμXtdt+σdWt

where theta, sigma, and mu are real constants.

• 

The parameter x0 defines the initial value of the underlying stochastic process.

• 

The parameter theta is the speed of mean-reversion. The parameter mu is the long-running mean. The parameter sigma is the volatility. In general, theta, mu, and sigma can be any algebraic expressions. However, if the process is to be simulated, these parameters must be assigned numeric values.

• 

The scheme option specifies the discretization scheme used for simulation of this process. By default the standard Euler scheme is used. When scheme is set to unbiased the transition density will be used to simulate a value Xt+dt given Xt.

Examples

withFinance:

r:=OrnsteinUhlenbeckProcessr0,μ,θ,σ

r:=_X

(1)

Driftrt

θμ_Xt

(2)

Diffusionrt

σ

(3)

r0:=0.5

r0:=0.5

(4)

θ:=1.0

θ:=1.0

(5)

μ:=0.25

μ:=0.25

(6)

σ:=0.3

σ:=0.3

(7)

PathPlotrt,t=0..3,timesteps=100,replications=10,thickness=3,color=red..blue,axes=BOXED

Here is an example using the transition density.

μ:=0.02

μ:=0.02

(8)

θ:=1.0

θ:=1.0

(9)

σ:=0.001

σ:=0.001

(10)

r0:=0.05

r0:=0.05

(11)

r:=OrnsteinUhlenbeckProcessr0,μ,θ,σ

r:=_X0

(12)

q:=OrnsteinUhlenbeckProcessr0,μ,θ,σ,scheme=unbiased

q:=_X1

(13)

p:=dsolveⅆⅆtxt=θμxt,x0=r0

p:=xt=150+3100ⅇt

(14)

P1:=PathPlotrt,t=0..5,timesteps=5,replications=1,color=red:

P2:=PathPlotqt,t=0..5,timesteps=5,replications=1,color=blue:

P3:=plotrhsp,t=0..5,color=green:

plots[display]P1,P2,P3,thickness=3,axes=BOXED

Here is a realization of the Ornstein-Uhlenbeck process as a subordinated Wiener process.

μ:=0.02

μ:=0.02

(15)

θ:=1.0

θ:=1.0

(16)

σ:=0.01

σ:=0.01

(17)

r0:=0.05

r0:=0.05

(18)

r:=OrnsteinUhlenbeckProcessr0,μ,θ,σ

r:=_X2

(19)

τ:=ⅇ2θt12θ

τ:=0.5000000000ⅇ2.0t0.5000000000

(20)

W:=WienerProcessτ

W:=_W

(21)

q:=t→r0ⅇθt+μ1ⅇθt+σⅇθtWt

q:=t→r0ⅇθt+μ1ⅇθt+σⅇθtWt

(22)

R:=PathPlotrt,t=0..3,timesteps=100,replications=3,thickness=3,color=red:

Q:=PathPlotqt,t=0..3,timesteps=100,replications=3,thickness=3,color=blue:

plots[display]R,Q

ExpectedValue∫01ruⅆu,replications=104,timesteps=100

value=0.03902469384,standarderror=0.00004066146237

(23)

ExpectedValue∫01quⅆu,replications=104,timesteps=100

value=0.03898350713,standarderror=0.0001753525705

(24)

See Also

Finance[BlackScholesProcess], Finance[BrownianMotion], Finance[Diffusion], Finance[Drift], Finance[ExpectedValue], Finance[GeometricBrownianMotion], Finance[HullWhiteProcess], Finance[ItoProcess], Finance[SamplePath], Finance[SampleValues], Finance[SquareRootDiffusion], Finance[StochasticProcesses], Finance[WienerProcess]

References

  

Brigo, D., Mercurio, F., Interest Rate Models: Theory and Practice. New York: Springer-Verlag, 2001.

  

Glasserman, P., Monte Carlo Methods in Financial Engineering. New York: Springer-Verlag, 2004.

  

Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003.

  

Vasicek, O.A., An Equilibrium Characterization of the Term Structure, Journal of Financial Economics, 5 (1977), pp 177-188.


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam