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
Click For Summary
SUMMARY

This discussion focuses on generating a Wiener Process graph using MATLAB for a mathematical essay on Option Pricing. The key MATLAB code provided includes defining the time increment (dt), the number of points (N), generating normally distributed random numbers (epsilon), and computing the cumulative sum (z) to plot the graph. The specific MATLAB commands shared are essential for visualizing the Wiener Process accurately.

PREREQUISITES
  • Understanding of stochastic processes, specifically Wiener Processes.
  • Familiarity with MATLAB programming environment.
  • Knowledge of random number generation in MATLAB.
  • Basic concepts of cumulative sums and plotting in MATLAB.
NEXT STEPS
  • Explore MATLAB's random number generation functions, specifically 'randn'.
  • Learn about cumulative distribution functions and their applications in MATLAB.
  • Research advanced plotting techniques in MATLAB for enhanced data visualization.
  • Study the mathematical foundations of Option Pricing models and their graphical representations.
USEFUL FOR

Mathematicians, financial analysts, students working on Option Pricing, and anyone interested in stochastic processes and MATLAB programming.

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:

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
3K
Replies
2
Views
3K
  • · 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