- 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
This code is good
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 ?
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]));
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.
Brownian motions added
I corrected a typo. CIR stands for Cox- Ingersoll-Ross, I previously entered CID
I corrected a typo. This CIR stands for Cox-