Main Content

bm

Brownian motion (BM) models

Description

Creates and displays Brownian motion (sometimes calledarithmetic Brownian motionorgeneralized Wiener process)bmobjects that derive from thesdeld(SDE with drift rate expressed in linear form) class.

Usebmobjects to simulate sample paths ofNVarsstate variables driven byNBrownssources of risk overNPeriodsconsecutive observation periods, approximating continuous-time Brownian motion stochastic processes. This enables you to transform a vector ofNBrownsuncorrelated, zero-drift, unit-variance rate Brownian components into a vector ofNVarsBrownian components with arbitrary drift, variance rate, and correlation structure.

Usebmto simulate any vector-valued BM process of the form:

d X t = μ ( t ) d t + V ( t ) d W t

where:

  • Xtis anNVars-by-1state vector of process variables.

  • μis anNVars-by-1drift-rate vector.

  • Vis anNVars-by-NBrownsinstantaneous volatility rate matrix.

  • dWtis anNBrowns-by-1vector of (possibly) correlated zero-drift/unit-variance rate Brownian components.

Creation

Description

example

BM= bm(Mu,Sigma)creates a defaultBMobject.

Specify required input parameters as one of the following types:

  • A MATLAB®array. Specifying an array indicates a static (non-time-varying) parametric specification. This array fully captures all implementation details, which are clearly associated with a parametric form.

  • A MATLAB function. Specifying a function provides indirect support for virtually any static, dynamic, linear, or nonlinear model. This parameter is supported via an interface, because all implementation details are hidden and fully encapsulated by the function.

Note

You can specify combinations of array and function input parameters as needed.

Moreover, a parameter is identified as a deterministic function of time if the function accepts a scalar timetas its only input argument. Otherwise, a parameter is assumed to be a function of timetand stateX(t)and is invoked with both input arguments.

example

BM= bm(___,Name,Value)creates abmobject with additional options specified by one or moreName,Valuepair arguments.

Nameis a property name andValueis its corresponding value.Namemust appear inside single quotes (''). You can specify several name-value pair arguments in any order asName1,Value1,…,NameN,ValueN

TheBMobject has the followingProperties:

  • 明星tTime— Initial observation time

  • 明星tState— Initial state at time明星tTime

  • Correlation— Access function for theCorrelationinput argument, callable as a function of time

  • Drift— Composite drift-rate function, callable as a function of time and state

  • Diffusion— Composite diffusion-rate function, callable as a function of time and state

  • Simulation— A simulation function or method

Input Arguments

expand all

Murepresents the parameterμ, specified as an array or deterministic function of time.

If you specifyMuas an array, it must be anNVars-by-1column vector representing the drift rate (the expected instantaneous rate of drift, or time trend).

As a deterministic function of time, whenMuis called with a real-valued scalar timetas its only input,Mumust produce anNVars-by-NVarsmatrix. If you specifyMuas a function of time and state, it calculates the expected instantaneous rate of drift. This function must generate anNVars-by-1column vector when invoked with two inputs:

  • A real-valued scalar observation timet.

  • AnNVars-by-1state vectorXt.

Data Types:double|function_handle

Sigmarepresents the parameterV, specified as an array or deterministic function of time.

If you specifySigmaas an array, it must be anNVars-by-NBrownsmatrix of instantaneous volatility rates or as a deterministic function of time. In this case, each row ofSigmacorresponds to a particular state variable. Each column corresponds to a particular Brownian source of uncertainty, and associates the magnitude of the exposure of state variables with sources of uncertainty.

As a deterministic function of time, whenSigmais called with a real-valued scalar timetas its only input,Sigmamust produce anNVars-by-NBrownsmatrix. If you specifySigmaas a function of time and state, it must return anNVars-by-NBrownsmatrix of volatility rates when invoked with two inputs:

  • A real-valued scalar observation timet.

  • AnNVars-by-1state vectorXt.

虽然gbm构造tor enforces no restrictions on the sign ofSigmavolatilities, they are specified as positive values.

Data Types:double|function_handle

Properties

expand all

明星ting time of first observation, applied to all state variables, specified as a numeric.

Data Types:double

Initial values of state variables, specified as a scalar, column vector, or matrix.

If明星tStateis a scalar,bmapplies the same initial value to all state variables on all trials.

If明星tStateis a column vector,bmapplies a unique initial value to each state variable on all trials.

If明星tStateis a matrix,bmapplies a unique initial value to each state variable on each trial.

Data Types:double

Correlation between Gaussian random variates drawn to generate the Brownian motion vector (Wiener processes), specified as anNBrowns-by-NBrownspositive semidefinite matrix, or as a deterministic functionC(t)that accepts the current timetand returns anNBrowns-by-NBrownspositive semidefinite correlation matrix. IfCorrelationis not a symmetric positive semidefinite matrix, usenearcorrto create a positive semidefinite matrix for a correlation matrix.

ACorrelationmatrix represents a static condition.

As a deterministic function of time,Correlationallows you to specify a dynamic correlation structure.

Data Types:double

User-defined simulation function or SDE simulation method, specified as a function or SDE simulation method.

Data Types:function_handle

This property is read-only.

Drift rate component of continuous-time stochastic differential equations (SDEs), specified as a drift object or function accessible by (t,Xt.

The drift rate specification supports the simulation of sample paths ofNVarsstate variables driven byNBrownsBrownian motion sources of risk overNPeriodsconsecutive observation periods, approximating continuous-time stochastic processes.

Thedriftclass allows you to create drift-rate objects usingdriftof the form:

F ( t , X t ) = A ( t ) + B ( t ) X t

where:

  • Ais anNVars-by-1vector-valued function accessible using the (t,Xt) interface.

  • Bis anNVars-by-NVarsmatrix-valued function accessible using the (t,Xt) interface.

The displayed parameters for adriftobject are:

  • Rate: The drift-rate function,F(t,Xt)

  • A: The intercept term,A(t,Xt), ofF(t,Xt)

  • B: The first order term,B(t,Xt), ofF(t,Xt)

AandBenable you to query the original inputs. The function stored inRatefully encapsulates the combined effect ofAandB.

When specified as MATLAB double arrays, the inputsAandBare clearly associated with a linear drift rate parametric form. However, specifying eitherAorBas a function allows you to customize virtually any drift rate specification.

Note

You can expressdriftanddiffusionclasses in the most general form to emphasize the functional (t,Xt) interface. However, you can specify the componentsAandBas functions that adhere to the common (t,Xt) interface, or as MATLAB arrays of appropriate dimension.

Example:F = drift(0, 0.1) % Drift rate function F(t,X)

Data Types:object

This property is read-only.

Diffusion rate component of continuous-time stochastic differential equations (SDEs), specified as a drift object or function accessible by (t,Xt.

The diffusion rate specification supports the simulation of sample paths ofNVarsstate variables driven byNBrownsBrownian motion sources of risk overNPeriodsconsecutive observation periods, approximating continuous-time stochastic processes.

Thediffusionclass allows you to create diffusion-rate objects usingdiffusion:

G ( t , X t ) = D ( t , X t α ( t ) ) V ( t )

where:

  • Dis anNVars-by-NVarsdiagonal matrix-valued function.

  • Each diagonal element ofDis the corresponding element of the state vector raised to the corresponding element of an exponentAlpha, which is anNVars-by-1vector-valued function.

  • Vis anNVars-by-NBrownsmatrix-valued volatility rate functionSigma.

  • AlphaandSigmaare also accessible using the (t,Xt) interface.

The displayed parameters for adiffusionobject are:

  • Rate: The diffusion-rate function,G(t,Xt).

  • Alpha: The state vector exponent, which determines the format ofD(t,Xt)ofG(t,Xt).

  • Sigma: The volatility rate,V(t,Xt), ofG(t,Xt).

AlphaandSigmaenable you to query the original inputs. (The combined effect of the individualAlphaandSigmaparameters is fully encapsulated by the function stored inRate.) TheRatefunctions are the calculation engines for thedriftanddiffusionobjects, and are the only parameters required for simulation.

Note

You can expressdriftanddiffusionclasses in the most general form to emphasize the functional (t,Xt) interface. However, you can specify the componentsAandBas functions that adhere to the common (t,Xt) interface, or as MATLAB arrays of appropriate dimension.

Example:G = diffusion(1, 0.3) % Diffusion rate function G(t,X)

Data Types:object

Object Functions

interpolate Brownian interpolation of stochastic differential equations (SDEs) forSDE,BM,GBM,CEV,CIR,HWV,Heston,SDEDDO,SDELD, orSDEMRDmodels
simulate Simulate multivariate stochastic differential equations (SDEs) forSDE,BM,GBM,CEV,CIR,HWV,Heston,SDEDDO,SDELD,SDEMRD,Merton, orBatesmodels
simByEuler Euler simulation of stochastic differential equations (SDEs) forSDE,BM,GBM,CEV,CIR,HWV,Heston,SDEDDO,SDELD, orSDEMRDmodels

Examples

全部折叠

Create a univariate Brownian motion (bm) object to represent the model: d X t = 0 . 3 d W t .

obj = bm(0, 0.3)% (A = Mu, Sigma)
obj = Class BM: Brownian Motion ---------------------------------------- Dimensions: State = 1, Brownian = 1 ---------------------------------------- StartTime: 0 StartState: 0 Correlation: 1 Drift: drift rate function F(t,X(t)) Diffusion: diffusion rate function G(t,X(t)) Simulation: simulation method/function simByEuler Mu: 0 Sigma: 0.3

bmobjects display the parameterAas the more familiarMu.

Thebmclass also provides an overloaded Euler simulation method that improves run-time performance in certain common situations. This specialized method is invoked automatically only ifallthe following conditions are met:

  • 预期的漂移或趋势,rateMuis a column vector.

  • The volatility rate,Sigma, is a matrix.

  • No end-of-period adjustments and/or processes are made.

  • If specified, the random noise processZis a three-dimensional array.

  • IfZis unspecified, the assumed Gaussian correlation structure is a double matrix.

More About

expand all

Algorithms

When you specify the required input parameters as arrays, they are associated with a specific parametric form. By contrast, when you specify either required input parameter as a function, you can customize virtually any specification.

Accessing the output parameters with no inputs simply returns the original input specification. Thus, when you invoke these parameters with no inputs, they behave like simple properties and allow you to test the data type (double vs. function, or equivalently, static vs. dynamic) of the original input specification. This is useful for validating and designing methods.

When you invoke these parameters with inputs, they behave like functions, giving the impression of dynamic behavior. The parameters accept the observation timetand a state vectorXt, and return an array of appropriate dimension. Even if you originally specified an input as an array,bmtreats it as a static function of time and state, by that means guaranteeing that all parameters are accessible by the same interface.

References

[1] Aït-Sahalia, Yacine. “Testing Continuous-Time Models of the Spot Interest Rate.”Review of Financial Studies, vol. 9, no. 2, Apr. 1996, pp. 385–426.

[2] Aït-Sahalia, Yacine. “Transition Densities for Interest Rate and Other Nonlinear Diffusions.”The Journal of Finance, vol. 54, no. 4, Aug. 1999, pp. 1361–95.

[3] Glasserman, Paul.Monte Carlo Methods in Financial Engineering. Springer, 2004.

[4] Hull, John.Options, Futures and Other Derivatives. 7th ed, Prentice Hall, 2009.

[5] Johnson, Norman Lloyd, et al.Continuous Univariate Distributions. 2nd ed, Wiley, 1994.

[6] Shreve, Steven E.Stochastic Calculus for Finance. Springer, 2004.

Version History

Introduced in R2008a