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

timegrid

-

range or time grid data structure; time grid

timeinterval

-

range; time interval

expression

-

algebraic expression; expression whose value is to be generated

opts

-

(optional) equation(s) of the form option = value where option is one of replications or timesteps; specify options for the SampleValues 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.

•

timesteps = posint -- This option specifies the number of time steps. This option is ignored if an explicit time grid is specified. By default, only one time step is used.

Description

•

The SampleValues(pathfunction, pathgenerator, opts) calling sequence computes a Monte Carlo estimate of pathfunction using sample paths generated by pathgenerator. The procedure consists of the following steps:

–

Generate a replication of the sample path using the specified path generator and store these values as a Maple Array, for example . In the case of a one-dimensional process is a one-dimensional array of size , where is the number of points in the time grid (the number of time steps plus one). In the case of a multi-dimensional process, is a two-dimensional array of size , where is the dimension of the underlying stochastic process and is the same as in the one-dimensional case.

–

Compute the value .

–

Repeat the above two steps the specified number of times (see the replications option).

•

The SampleValues(pathfunction, process, timegrid, opts) and SampleValues(pathfunction, process, timeinterval, opts) calling sequences first construct the corresponding path generator and then perform the same computations as above.

•

The parameter timeinterval must be of type range , where and are non-negative constants such that .

•

When the ExpectedValue(pathfunction, process, timeinterval, opts) calling sequence is used, the uniform time grid between and (with time steps ) is generated.

Note that if , the value at 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 and , but will have no effect on the value at . To reduce the bias, use a time interval of the form .

•

The SampleValues(expression, opts) calling sequence attempts to extract all the stochastic variables involved in expression and generate the corresponding path generator and path function using the specified number of time steps. In particular, SampleValues will extract all time instances involved in expression and adjust them so that they belong to the grid.

All stochastic variables involved in expression should be of the form , where is some expression. If is multi-dimensional stochastic, then the individual components of can be accessed using the notation .