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

  • MATLAB
  • Thread starter blahblah8724
  • Start date
  • Tags
    Graph Matlab
In summary, the conversation discusses the use of MATLAB to produce a graph for a mathematical essay on Option Pricing. The graph displays a process called a Wiener Process, which models the change in a time interval using a normal random variable with mean zero and variance one. The conversation includes the necessary steps to compute the graph using MATLAB, including selecting a time interval, generating random numbers, and plotting the graph.
  • #1
blahblah8724
32
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
  • #2


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:

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

1. What is MATLAB and how is it used for producing graphs?

MATLAB is a high-level programming language and interactive environment commonly used by scientists and engineers for data analysis, visualization, and algorithm development. It has a built-in function for creating various types of graphs and plots, making it a powerful tool for scientific research.

2. How do I import data into MATLAB for graphing?

To import data into MATLAB, you can either use the "importdata" function or create a script to read the data from a file. The data can be in various formats such as CSV, Excel, or text files. Once imported, you can manipulate and plot the data using MATLAB's functions.

3. Can I customize the appearance of the graph in MATLAB?

Yes, MATLAB allows you to customize various aspects of the graph, such as the axes, labels, colors, and markers. You can use the "plot" function to specify these customizations or use the "set" function to modify them after creating the graph.

4. Is it possible to add multiple data sets to a single graph in MATLAB?

Yes, you can add multiple data sets to a single graph in MATLAB by using the "hold on" command. This command allows you to plot multiple data sets on the same axes, making it easier to compare and analyze the data.

5. Can I export my MATLAB graph to a different format?

Yes, you can export your MATLAB graph to various formats, such as PNG, JPEG, or PDF. You can use the "saveas" function to save the graph in a specific format or use the "print" function to print the graph directly from MATLAB.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
Back
Top