Code covered by the BSD License  

Highlights from
Plot Some Paths

5.0

5.0 | 4 ratings Rate this file 12 Downloads (last 30 days) File Size: 10.13 KB File ID: #22312
image thumbnail

Plot Some Paths

by Rodolphe Sitter

 

04 Dec 2008 (Updated 10 Dec 2008)

This application allows you to generate and visualize some random paths

| Watch this File

File Information
Description

- 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

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
07 Dec 2008 Rodolphe Sitter  
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.

27 Jan 2009 Hairui

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,

Hairui

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 ?

Cheers,
Rodolphe

18 Feb 2009 Rafael Curiel

This code is good
thank you

Please login to add a comment or rating.
Updates
05 Dec 2008

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

06 Dec 2008

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

09 Dec 2008

Brownian motions added

10 Dec 2008

updated

Tag Activity for this File
Tag Applied By Date/Time
finance Rodolphe Sitter 04 Dec 2008 15:57:53
plot Rodolphe Sitter 04 Dec 2008 15:57:54
generate Rodolphe Sitter 04 Dec 2008 15:57:54
paths Rodolphe Sitter 04 Dec 2008 15:57:54
cir Rodolphe Sitter 04 Dec 2008 15:57:54
vasicek Rodolphe Sitter 04 Dec 2008 15:57:54
finance Cristina McIntire 05 Dec 2008 14:36:00
plot Cristina McIntire 05 Dec 2008 14:36:00
paths Cristina McIntire 05 Dec 2008 14:36:00
generate soni Soni 07 Dec 2008 04:38:11
coxingersollross Rodolphe Sitter 08 Dec 2008 12:12:36
random Rodolphe Sitter 08 Dec 2008 12:12:36
ross Rodolphe Sitter 08 Dec 2008 12:12:36
ingersoll Rodolphe Sitter 08 Dec 2008 12:12:36
cox Rodolphe Sitter 08 Dec 2008 12:12:36
cox ingersollross Rodolphe Sitter 08 Dec 2008 12:13:00
interest rate Rodolphe Sitter 08 Dec 2008 12:13:00
gui Rodolphe Sitter 08 Dec 2008 12:13:00
brownian Rodolphe Sitter 09 Dec 2008 13:47:29
motion Rodolphe Sitter 09 Dec 2008 13:47:29
brownian bridge Rodolphe Sitter 10 Dec 2008 15:52:36
gui Cristina McIntire 10 Dec 2008 15:54:27
brownian Enrico 25 May 2010 11:06:06
cir Yunhao li 25 Oct 2010 16:08:47

Contact us at files@mathworks.com