View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Plot Some Paths

5.0 | 5 ratings Rate this file 8 Downloads (last 30 days) File Size: 9.26 KB File ID: #22312 Version: 1.8
image thumbnail

Plot Some Paths



04 Dec 2008 (Updated )

This application allows you to generate and visualize some random paths

| Watch this File

File Information

- Plot arithmetic and geometric Brownian motions
- Plot Brownian bridges, 2D and 3D Brownian motions
- Plot some random paths for the the interest spot rate:
The two models you can chose from are the Vasicek and the Cox- Ingersoll-Ross (CIR) models


Kernel Smoothing Regression inspired this file.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
31 Oct 2012 Stefan

Stefan (view profile)

18 Feb 2009 Rafael Curiel

This code is good
thank you

31 Jan 2009 Rodolphe Sitter

Thanks Hairi,

It would indeed be a good idea to make it more flexible, I just haven't gotten around to doing this.
Could you kindly describe what your functions "sedddo"and "simByEuler" do ?


Comment only
27 Jan 2009 Hairui

Hairui (view profile)

Your project is very impressive. I really love the idea of combining GUI and m-code to visualize the stochastic processes.

Meanwhile, I think the SDE class in Matlab might be useful if you want to make your project more flexible. I don't know whether this can help, but here's my code of generating random paths using Vasicek:

ntrials = 200;
Steps = 1000;
kappa = 2;
theta = 1;
sigma = 0.4;
X0 = 1;
s = sdeddo(drift(kappa, theta), diffusion(0, sigma), 'StartTime', 0, 'StartState', X0);
p = s.simByEuler(Steps, 'DeltaTime', 1e-4, 'NTRIALS', ntrials);
plot(reshape(p, [Steps + 1, ntrials]));

Kind regards,


09 Dec 2008 Stephen Huang

This code is extremely helpful to visualize four of most important stochastic models in quantitative finance. I strong recommend this to any one who wants to enter this field.

07 Dec 2008 Rodolphe Sitter

05 Dec 2008 1.3

I corrected a typo. This CIR stands for Cox-
Ingersoll-Ross, I previously entered CID

06 Dec 2008 1.5

I corrected a typo. CIR stands for Cox- Ingersoll-Ross, I previously entered CID

09 Dec 2008 1.7

Brownian motions added

10 Dec 2008 1.8


Contact us