Finance
OrnsteinUhlenbeckProcess
create new Ornstein-Uhlenbeck process
Calling Sequence
Parameters
Options
Description
Examples
References
Compatibility
OrnsteinUhlenbeckProcess(x0, mu, theta, sigma, opts)
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
scheme = unbiased or Euler -- This option specifies which discretization scheme should be used for simulating this process.
The OrnsteinUhlenbeckProcess command creates an Ornstein-Uhlenbeck process. This is a stochastic process X⁡t governed by the stochastic differential equation (SDE)
dX⁡t=θ⁢μ−X⁡t⁢dt+σ⁢dW⁡t
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 X⁡t+dt given X⁡t.
with⁡Finance:
r≔OrnsteinUhlenbeckProcess⁡r0,μ,θ,σ
r≔_X0
Drift⁡r⁡t
θ⁢μ−_X0⁡t
Diffusion⁡r⁡t
σ
r0≔0.5
θ≔1.0
μ≔0.25
σ≔0.3
PathPlot⁡r⁡t,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.001
r0≔0.05
r≔_X1
q≔OrnsteinUhlenbeckProcess⁡r0,μ,θ,σ,scheme=unbiased
q≔_X2
p≔dsolve⁡diff⁡x⁡t,t=θ⁢μ−x⁡t,x⁡0=r0
p≔x⁡t=150+3⁢ⅇ−t100
P1≔PathPlot⁡r⁡t,t=0..5,timesteps=5,replications=1,color=red:
P2≔PathPlot⁡q⁡t,t=0..5,timesteps=5,replications=1,color=blue:
P3≔plot⁡rhs⁡p,t=0..5,color=green:
plotsdisplay⁡P1,P2,P3,thickness=3,axes=BOXED
Here is a realization of the Ornstein-Uhlenbeck process as a subordinated Wiener process.
σ≔0.01
r≔_X3
τ≔exp⁡2⁢θ⁢t−12⁢θ
τ≔0.5000000000⁢ⅇ2.0⁢t−0.5000000000
W≔WienerProcess⁡τ
W≔_W
q≔t↦r0⋅exp⁡−θ⋅t+μ⋅1−exp⁡−θ⋅t+σ⋅exp⁡−θ⋅t⋅W⁡t
q≔t↦r0⋅ⅇ−θ⋅t+μ⋅1−ⅇ−θ⋅t+σ⋅ⅇ−θ⋅t⋅W⁡t
R≔PathPlot⁡r⁡t,t=0..3,timesteps=100,replications=3,thickness=3,color=red:
Q≔PathPlot⁡q⁡t,t=0..3,timesteps=100,replications=3,thickness=3,color=blue:
plotsdisplay⁡R,Q
ExpectedValue⁡Int⁡r⁡u,u=0..1,replications=104,timesteps=100
value=0.03902469384,standarderror=0.00004066146237
ExpectedValue⁡Int⁡q⁡u,u=0..1,replications=104,timesteps=100
value=0.03898350713,standarderror=0.0001753525705
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.
The Finance[OrnsteinUhlenbeckProcess] command was introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
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]
Download Help Document