2.0

2.0 | 1 rating Rate this file 98 downloads (last 30 days) File Size: 370 Bytes File ID: #18060

Brownian Motion

by Abhirup Lahiri

 

18 Dec 2007 (Updated 21 Dec 2007)

No BSD License  

Function to simulate Brownian Motion

Download Now | Watch this File

File Information
Description

The brownian motion is a function very commonly used in Stochastic Calculus. It is a continous process but not a differentiable function.
The file/function simulate a Brownian Motion Path using the quadratic variation process <W>_t=t
As a word of caution one of the the inputs for the function is t which is not time vector but the upper limit of time till which computation is required ( Eg : t=1sec).
Moreover, to make the function simple and self contained the command "Cumulative-Sum(cumsum)" is not used. This is done to make things clear so that any beginner can also follow the code.

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
18 Dec 2007 Jos x@y.z

What I like: it pre-allocates the output.

What I do not like:
1) The help is very poor: if I follow it, the function errors when I enter a time vector (e.g., 1:10) and a number of samples (10). Probably t is to be a scalar also, but that is not clear. It has no H1 line, no useful help on its inputs or outputs, no example.

2) It has no error checks on its inputs, checking for common mistakes (like no scalar inputs).
 
3) It is poorly programmed, calculating unused variables, etc, setting the rand state without warning, no internal comments

4) it is very trivial, and can be coded in one line: "w = [0 ; cumsum(sqrt(t/n).*rand(n-1,2))]; "

Finaly, try to make clear why anybody wishes to use of this function.

I think this submission is to be rated 1.5 stars ...

Please login to add a comment or rating.
Updates
21 Dec 2007

Minor Changes in Description

Tag Activity for this File
Tag Applied By Date/Time
simulation Abhirup Lahiri 22 Oct 2008 09:39:52
brownian Abhirup Lahiri 22 Oct 2008 09:39:52
brownian motion Abhirup Lahiri 22 Oct 2008 09:39:52
cont Abhirup Lahiri 22 Oct 2008 09:39:52
simulation model Abhirup Lahiri 22 Oct 2008 09:39:52
stochastic calculus Abhirup Lahiri 22 Oct 2008 09:39:52
brownian motion Rainer haidiger 21 Apr 2009 06:52:48
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com