How to create Brownian Motion Model and GBM in Matlab

Here are some popular ways to create BMs within Matlab. From the help system:

Creating Brownian Motion (BM) Models

The Brownian Motion (BM) model derives directly from the linear drift (SDELD) class:

Example: BM Models. Create a univariate Brownian motion (BM) object to represent the model:

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

BM objects display the parameter A as the more familiar Mu.

The BM class also provides an overloaded Euler simulation method that improves run time performance in certain common situations. This specialized method is invoked automatically only if all of the following conditions are met:

*

The expected drift, or trend, rate Mu is 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 process Z is a three-dimensional array.
*

If Z is unspecified, the assumed Gaussian correlation structure is a double matrix.

Creating Geometric Brownian Motion (GBM) Models

The Geometric Brownian Motion (GBM) model derives directly from the CEV model:

Compared to CEV, GBM constrains all elements of the alpha exponent vector to one such that D is now a diagonal matrix with the state vector X along the main diagonal.

The GBM class also provides two simulation methods that can be used by separable models:

*

An overloaded Euler simulation method that improves run time performance in certain common situations. This specialized method is invoked automatically only if all of the following conditions are true:
o

The expected rate of return (Return) is a diagonal matrix.
o

The volatility rate (Sigma) is a matrix.
o

No end-of-period adjustments/processes are made.
o

If specified, the random noise process Z is a three-dimensional array.
o

If Z is unspecified, the assumed Gaussian correlation structure is a double matrix.

*

An approximate analytic solution (simBySolution) obtained by applying an Euler approach to the transformed (using Ito’s formula) logarithmic process. In general, this is not the exact solution to this GBM model, as the probability distributions of the simulated and true state vectors are identical only for piecewise constant parameters. If the model parameters are piecewise constant over each observation period, the state vector Xt is log-normally distributed and the simulated process is exact for the observation times at which Xt is sampled.

Example: Univariate GBM Models. Create a univariate GBM object to represent the model:

obj = gbm(0.25, 0.3) % (B = Return, Sigma)
obj =
Class GBM: Generalized Geometric Brownian Motion
————————————————
Dimensions: State = 1, Brownian = 1
————————————————
StartTime: 0
StartState: 1
Correlation: 1
Drift: drift rate function F(t,X(t))
Diffusion: diffusion rate function G(t,X(t))
Simulation: simulation method/function simByEuler
Return: 0.25
Sigma: 0.3

How would you build an indie trading business?

Signup now and receive an email as I implement the next steps

I will never give away, trade or sell your email address. You can unsubscribe at any time.

About caustic

Hi i there My name is Bryan Downing. I am part of a company called QuantLabs.Net This is specifically a company with a high profile blog about technology, trading, financial, investment, quant, etc. It posts things on how to do job interviews with large companies like Morgan Stanley, Bloomberg, Citibank, and IBM. It also posts different unique tips and tricks on Java, C++, or C programming. It posts about different techniques in learning about Matlab and building models or strategies. There is a lot here if you are into venturing into the financial world like quant or technical analysis. It also discusses the future generation of trading and programming Specialties: C++, Java, C#, Matlab, quant, models, strategies, technical analysis, linux, windows P.S. I have been known to be the worst typist. Do not be offended by it as I like to bang stuff out and put priorty of what I do over typing. Maybe one day I can get a full time copy editor to help out. Do note I prefer videos as they are much easier to produce so check out my many video at youtube.com/quantlabs

Leave a Reply

Your email address will not be published. Required fields are marked *


*