File Exchange

## Plot Some Paths

version 1.8 (9.26 KB) by

This application allows you to generate and visualize some random paths

Updated

- 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

Stefan

Rafael Curiel

### Rafael Curiel (view profile)

This code is good
thank you

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

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

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.

Rodolphe Sitter

### Rodolphe Sitter (view profile)

 10 Dec 2008 1.8 updated 9 Dec 2008 1.7 Brownian motions added 6 Dec 2008 1.5 I corrected a typo. CIR stands for Cox- Ingersoll-Ross, I previously entered CID 5 Dec 2008 1.3 I corrected a typo. This CIR stands for Cox- Ingersoll-Ross, I previously entered CID
##### MATLAB Release
MATLAB 7.5 (R2007b)
##### Acknowledgements

Inspired by: Kernel Smoothing Regression

Play today