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

1. Dec 24, 2011

### blahblah8724

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 modelled 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

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

I would really appreciate any help!

Thank :)

2. Dec 27, 2011

### jasonRF

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

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: Dec 27, 2011