Finance - Maple Help

Online Help

All Products    Maple    MapleSim


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

Finance

  

GeometricBrownianMotion

  

create new Brownian motion process

 

Calling Sequence

Parameters

Options

Description

Examples

References

Compatibility

Calling Sequence

GeometricBrownianMotion(x0, mu, sigma, opts)

GeometricBrownianMotion(x0, mu, sigma, t, opts)

Parameters

x0

-

real constant; initial value

mu

-

algebraic expression, operator or procedure; drift parameter

sigma

-

algebraic expression, operator, procedure or a one-dimensional stochastic process; volatility parameter

t

-

name; time parameter

opts

-

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

Options

• 

scheme = unbiased or Euler -- This option specifies which discretization scheme should be used for simulating this process.

Description

• 

The GeometricBrownianMotion command creates a new geometric Brownian motion process. This is a stochastic process St, which is governed by the stochastic differential equation (SDE)

dStSt=μtdt+σtdWt

where

– 

μ=μt is the drift parameter

– 

σ=σt is the volatility parameter

and

– 

Wt is the standard Wiener process.

• 

The parameter x0 defines the initial value of the underlying stochastic process. It must be a real constant.

• 

The parameter mu is the drift. In the simplest case of a constant drift mu is a real number (that is, any expression of type realcons). Time-dependent drift can be given either as an algebraic expression or as a Maple procedure. If mu is given as an algebraic expression, then the parameter t must be passed to specify which variable in mu should be used as a time variable. A Maple procedure defining a time-dependent drift must accept one parameter (the time) and return the corresponding value for the drift.

• 

The parameter sigma is the volatility. Similar to the drift parameter, the volatility can be constant or time-dependent. Unlike drift, volatility can involve other (one-dimensional) stochastic variables.

• 

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 St+dt given St. This scheme is appropriate in the case of a time-dependent drift and/or volatility.

• 

In the multi-dimensional case the drift and the volatility parameter must be constant. The drift parameter must be specified as a Vector and the volatility parameter must be a symmetric matrix that defines the covariance between the individual components.

Examples

withFinance:

T2.0

T:=2.0

(1)

First consider the case of a one-dimensional Brownian motion with constant drift and volatility.

XGeometricBrownianMotion1.0,0.02,0.3:

PathPlotXt,t=0..T,timesteps=100,replications=10,axes=BOXED,gridlines=true

Compute the drift and diffusion for functions of X.

WGeometricBrownianMotion1,μt,σt,t:

DriftWu

μt_X0u

(2)

DiffusionWu

σt_X0u

(3)

DriftlnWu

μt12σt2

(4)

Here is an example of a one-dimensional Brownian motion with time-dependent parameters given in algebraic form.

&mu;piecewiset<1&comma;0.02&comma;0.02t

&mu;:=&lcub;0.02t<10.02totherwise

(5)

&sigma;evalf&lsqb;3&rsqb;CurveFitting:-Spline0&comma;0.5&comma;1&comma;0.3&comma;1.5&comma;1.5&comma;2&comma;1.0&comma;t&comma;degree&equals;3

&sigma;:=&lcub;0.5001.40t&plus;1.20t3t<1.1.90&plus;2.20t&plus;3.601.&plus;t26.401.&plus;t3t<1.51.t6.t1.52&plus;4.t1.53otherwise

(6)

YGeometricBrownianMotion1.0&comma;&mu;&comma;&sigma;&comma;t&colon;

SSamplePathYt&comma;t&equals;0..T&comma;replications&equals;106&colon;

Here is the same example but with drift and volatility given in the form of Maple procedures.

&mu;unapply&mu;&comma;t

&mu;:=t&rarr;piecewiset<1&comma;0.02&comma;0.02t

(7)

&sigma;unapply&sigma;&comma;t

&sigma;:=t&rarr;piecewiset<1.&comma;0.5001.40t&plus;1.20t3&comma;t<1.5&comma;1.90&plus;2.20t&plus;3.601.&plus;t26.401.&plus;t3&comma;1.t6.t1.52&plus;4.t1.53

(8)

ZGeometricBrownianMotion1.0&comma;&mu;&comma;&sigma;&colon;

SSamplePathZt&comma;t&equals;0..T&comma;replications&equals;106&colon;

You can simulate values for any path function given as a Maple procedure.

XGeometricBrownianMotion1.0&comma;0.05&comma;0.3&colon;

VSampleValuesA&rarr;rtable_scanblockA&comma;rtable_dimsA&comma;&apos;:-Maximum&apos;&comma;X&comma;0..T&comma;timesteps&equals;100&comma;replications&equals;105&colon;

Here are examples involving stochastic volatility.

ROrnsteinUhlenbeckProcess0.5&comma;1.0&comma;0.5&comma;0.3&colon;

YGeometricBrownianMotion1.0&comma;0.0&comma;Rt2&comma;t&colon;

PathPlotYt&comma;t&equals;0..3&comma;timesteps&equals;100&comma;replications&equals;10&comma;axes&equals;BOXED&comma;gridlines&equals;true

Here is the same using different discretization schemes. For presentation purposes consider a geometric Brownian motion with very low volatility and time-dependent drift. Compare the simulated results with the corresponding solution of an ordinary (non-stochastic) differential equation.

fsint

f:=sint

(9)

W1GeometricBrownianMotion1.0&comma;f&comma;0.001&comma;t&colon;

W2GeometricBrownianMotion1.0&comma;f&comma;0.001&comma;t&comma;scheme&equals;unbiased&colon;

W3evalyt&comma;dsolve&DifferentialD;&DifferentialD;tytyt&equals;sint&comma;y0&equals;1.0

W3:=&ExponentialE;cost&ExponentialE;1

(10)

plots&lsqb;display&rsqb;plotW3&comma;t&equals;0..3&comma;PathPlotW1t&comma;t&equals;0..3&comma;timesteps&equals;10&comma;replications&equals;10&comma;thickness&equals;3&comma;axes&equals;BOXED&comma;gridlines&equals;true

plots&lsqb;display&rsqb;plotW3&comma;t&equals;0..3&comma;PathPlotW2t&comma;t&equals;0..3&comma;timesteps&equals;10&comma;replications&equals;10&comma;thickness&equals;3&comma;axes&equals;BOXED&comma;gridlines&equals;true

References

  

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.

Compatibility

• 

The Finance[GeometricBrownianMotion] 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[CEVProcess]

Finance[Diffusion]

Finance[Drift]

Finance[ExpectedValue]

Finance[ItoProcess]

Finance[SamplePath]

Finance[SampleValues]

Finance[StochasticProcesses]

Finance[WienerProcess]

 


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