Code covered by the BSD License

### Highlights from Plot Some Paths

5.0
5.0 | 5 ratings Rate this file 17 Downloads (last 30 days) File Size: 10.1 KB File ID: #22312

# Plot Some Paths

### Rodolphe Sitter (view profile)

04 Dec 2008 (Updated )

This application allows you to generate and visualize some random paths

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

Acknowledgements

Kernel Smoothing Regression inspired this file.

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

### Stefan (view profile)

18 Feb 2009 Rafael Curiel

### Rafael Curiel (view profile)

This code is good
thank you

31 Jan 2009 Rodolphe Sitter

### Rodolphe Sitter (view profile)

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

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,

Hairui

09 Dec 2008 Stephen Huang

### Stephen Huang (view profile)

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

### Rodolphe Sitter (view profile)

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

10 Dec 2008

updated