Does anyone know how to use MATLAB to produce this graph?

  • Context: MATLAB 
  • Thread starter Thread starter blahblah8724
  • Start date Start date
  • Tags Tags
    Graph Matlab
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
blahblah8724
Messages
31
Reaction score
0
Does anyone know how to use MATLAB to produce this graph??

I'm writing a mathematical essay on Option Pricing and would like to include a graph which displays a process called a Wiener Process.

This is basically a process where the change [itex]\Delta z[/itex] in a time interval [itex]\Delta t[/itex] is modeled by

[itex]\Delta z = \epsilon\sqrt{\Delta t}[/itex]

where [itex]\epsilon[/itex] is a normal random variable with mean 1 and variance 0.

So for each [itex]\Delta t[/itex], [itex]\epsilon[/itex] computes one normal random variable. And the true graph is obtained when [itex]\Delta t \to 0[/itex]. The graph should look something like this

HullBookF12-1-2.jpg



Does anyone know what the MATLAB sequence would be to compute this??

I would really appreciate any help!

Thank :)
 
Physics news on Phys.org


I am assuming you mean epsilon has mean zero and variance 1, since variance=0 means a constant. Anyway, you can do it something like this

dt = 0.01; % you pick this to be whatever you want
N = 1000; %number of points to use = whatever you want
epsilon = randn(N,1); %Nx1 vector of unit variance, zero mean normally distributed random numbers
dz = epsilon*sqrt(dt);
z = cumsum(dz); %sum up the dz
t = (0:N-1)*dt; %vector of t values
plot(t,z);

I think this is what you are looking for. Enjoy.

jason
 
Last edited: