Finance - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Finance : Stochastic Processes : Finance/PathPlot

Finance

  

PathPlot

  

plot sample path(s) of a stochastic process

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

PathPlot(samplepath, opts)

PathPlot(samplepath, i, opts)

PathPlot(expression, t = timeinterval, opts)

PathPlot(pathgenerator, opts)

PathPlot(process, timegrid, opts)

PathPlot(process, timeinterval, opts)

PathPlot(transform, pathgenerator, opts)

Parameters

samplepath

-

Array; array containing sample path(s) of a stochastic process

i

-

positive integer; coordinate of a multi-dimensional process to be plotted

expression

-

algebraic expression; expression whose sample path is to be generated

t

-

name; time variable for use in expression

timeinterval

-

range; time interval

pathgenerator

-

path generator data structure; path generator

process

-

one- or multi- dimensional stochastic process, or list or vector of one-dimensional stochastic processes

timegrid

-

list, Vector or time grid data structure; time grid

transform

-

procedure; path function

opts

-

(optional) equation(s) of the form option = value where option is one of timesteps, replications, color, markers, scale, or timegrid; specify options for the PathPlot command

Options

• 

replications = posint -- This option specifies the number of replications of the sample path. By default, only one replication of the sample path is generated. This option is invalid when an array containing sample path data is passed explicitly.

• 

timesteps = posint -- This option specifies the number of time steps. This option is ignored if explicit time grid is specified. By default, only one time step is used. This option is invalid when an array containing sample path data is passed explicitly.

• 

color = name, list, or range -- This option specifies colors for the individual paths. If a list of colors is given, each of the lines will be colored with the corresponding color in the list. If a range of colors is given, the colors will be generated by selecting an appropriate number of equally-spaced points in the corresponding hue range.

• 

markers = true or false -- This option specifies whether PathPlot plots the individual points.

• 

scale = absolute or relative -- This option controls whether the absolute or relative data scale is used. If scale is set to relative, all data samples are rescaled so that their range is an interval between -1 and 1.

• 

timegrid = range or a time grid data structure -- This option specifies the time grid to be used.

Description

• 

The PathPlot command generates a line chart for the specified sample path(s).

• 

The PathPlot(samplepath, opts) calling sequence plots data from samplepath as though it represents sample paths of a one-dimensional stochastic process. Each row of samplepath is taken as a single replication of the sample path.

• 

The PathPlot(samplepath, i, opts) calling sequence plots data from samplepath as though it represents sample paths of a multi-dimensional stochastic process.

• 

All the remaining calling sequences are closely related to the corresponding sequences for the SamplePath command. Essentially, they work as follows: the SamplePath command is called to generate an array containing sample paths for the underlying stochastic process. These sample paths are plotted using the procedure described above.

• 

The PathPlot(expression, t = timeinterval, opts) calling sequence attempts to extract all the stochastic variables involved in expression and generate the corresponding path generator and path function using the time grid or the specified number of time steps. In this case, only a one-dimensional path can be generated. The parameter timeinterval must be of type range T0..T1, where T0 and T1 are non-negative constants such that T0<T1.

  

Note that if 0<T0, the value at T0 will be simulated using a single step of the default discretization method and hence can suffer from a significant discretization bias. Increasing the number of time steps will refine the grid between T0 and T1, but will have no effect on the value at T0. To reduce the bias, use a time interval of the form 0..T1. All stochastic variables involved in expression should be of the form Xt. If X is multi-dimensional stochastic, then the individual components of X can be accessed using the notation Xti.

• 

The PathPlot(pathgenerator, opts) calling sequence plots the specified number of replications of the sample path using the path generator pathgenerator. For more details, see Finance[PathGenerator].

• 

The PathPlot(transform, pathgenerator, opts) calling sequence plots sample paths for a certain one-dimensional stochastic process given a path generator pathgenerator and a procedure transform that converts paths generated by pathgenerator to paths of the stochastic process of interest. Note that pathgenerator can be multi-dimensional.

• 

Note that the final plot data structure is built using the plots[display] command; all unprocessed parameters are treated as plot options and will be passed to plots[display].

Examples

withFinance&colon;

WWienerProcess&colon;

Generate plots for a given data sample.

ASamplePathWt&comma;t&equals;0..3&comma;timesteps&equals;100&comma;replications&equals;10

A:= 1..10 x 1..101 ArrayData Type: float8Storage: rectangularOrder: C_order

(1)

PathPlotA&comma;axes&equals;boxed&comma;gridlines&equals;true&comma;markers&equals;false&comma;thickness&equals;3&comma;color&equals;red..blue

PathPlotA&comma;timegrid&equals;0..1&comma;axes&equals;boxed&comma;gridlines&equals;true&comma;markers&equals;false&comma;thickness&equals;3&comma;color&equals;red..blue

TTimeGridseq1&plus;i100&comma;i&equals;1..100

T:=moduleend module

(2)

PathPlotA&comma;timegrid&equals;T&comma;axes&equals;boxed&comma;gridlines&equals;true

Display sample plots for a given stochastic process.

PathPlotWt&comma;t&equals;0..3&comma;timesteps&equals;100&comma;replications&equals;10&comma;axes&equals;boxed&comma;thickness&equals;3&comma;color&equals;red..blue

PathPlotWt&comma;t&equals;0..3&comma;timesteps&equals;100&comma;replications&equals;10&comma;thickness&equals;3&comma;axes&equals;boxed&comma;gridlines&equals;true

Generate sample paths for an expression involving stochastic variables.

PathPlot&ExponentialE;Wt&comma;t&equals;0..3&comma;timesteps&equals;100&comma;replications&equals;10&comma;axes&equals;boxed&comma;thickness&equals;3&comma;color&equals;red..blue

PathPlot&ExponentialE;Wt&comma;t&equals;0..3&comma;timesteps&equals;100&comma;replications&equals;10&comma;thickness&equals;3&comma;axes&equals;boxed&comma;gridlines&equals;true

The commands to create the plot from the Plotting Guide are as follows. They show examples involving a multi-variate stochastic process.

S0700

S0:=700

(3)

V00.1

V0:=0.1

(4)

&kappa;1.0

&kappa;:=1.0

(5)

&theta;0.1

&theta;:=0.1

(6)

&mu;0.05

&mu;:=0.05

(7)

&sigma;0.1

&sigma;:=0.1

(8)

&rho;0.5

&rho;:=0.5

(9)

SHestonProcessS0&comma;V0&comma;&mu;&comma;&theta;&comma;&kappa;&comma;&sigma;&comma;&rho;&colon;

ASamplePathSt&comma;t&equals;0..3&comma;timesteps&equals;100&comma;replications&equals;5

A:= 1..5 x 1..2 x 1..101 ArrayData Type: float8Storage: rectangularOrder: C_order

(10)

These are sample paths for the state variables.

PathPlotA&comma;timegrid&equals;0..3&comma;1&comma;thickness&equals;3&comma;color&equals;red..blue&comma;axes&equals;boxed&comma;gridlines&equals;true

And these are the corresponding sample paths for the volatility.

PathPlotA&comma;timegrid&equals;0..3&comma;2&comma;thickness&equals;3&comma;color&equals;red..blue&comma;axes&equals;boxed&comma;gridlines&equals;true

Compatibility

• 

The Finance[PathPlot] command was introduced in Maple 15.

• 

For more information on Maple 15 changes, see Updates in Maple 15.

See Also

Finance[SamplePath]

Finance[SampleValues]

Finance[StochasticProcesses]

plot,options

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam