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

  • Thread starter Thread starter blahblah8724
  • Start date Start date
  • Tags Tags
    Graph Matlab
Click For Summary
The discussion centers on creating a graph of a Wiener Process using MATLAB for a mathematical essay on Option Pricing. The Wiener Process is defined by the equation Δz = ε√Δt, where ε is a normal random variable with mean zero and variance one. A user seeks guidance on the MATLAB code to generate this graph. A response provides a MATLAB sequence that includes setting a time increment (dt), defining the number of points (N), generating random normal variables, calculating the increments (dz), and plotting the cumulative sum to visualize the Wiener Process. The suggested code effectively addresses the user's request for assistance in producing the desired graph.
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 \Delta z in a time interval \Delta t is modeled by

\Delta z = \epsilon\sqrt{\Delta t}

where \epsilon is a normal random variable with mean 1 and variance 0.

So for each \Delta t, \epsilon computes one normal random variable. And the true graph is obtained when \Delta t \to 0. 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:

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 1 ·
Replies
1
Views
4K