Finance[SampleValues] - generate sample value(s) for the specified expression
|
Calling Sequence
|
|
SampleValues(pathfunction, pathgenerator, opts)
SampleValues(pathfunction, process, timegrid, opts)
SampleValues(pathfunction, process, timeinterval, opts)
SampleValues(expression, opts)
|
|
Parameters
|
|
pathfunction
|
-
|
procedure; path function
|
pathgenerator
|
-
|
path generator data structure; path generator
|
process
|
-
|
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
|
|
|
|
|
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:
|
–
|
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 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.
|
|
|
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.
|
|
|
Compatibility
|
|
•
|
The Finance[SampleValues] command was introduced in Maple 15.
|
|
|
Examples
|
|
>
|
|
Here is a simple one-dimensional stochastic process.
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
Use a Maple procedure to compute the same expression.
>
|
|
>
|
|
>
|
|
| (4) |
>
|
|
| (5) |
Here is an example involving a multivariate stochastic process.
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
>
|
|
| (9) |
Here is the same computation using Maple procedures.
>
|
|
>
|
|
>
|
|
| (10) |
>
|
|
| (11) |
Use a two-dimensional Ito process using two one-dimensional projections and a given covariance matrix.
>
|
|
| (12) |
>
|
|
| (13) |
>
|
|
| (14) |
>
|
|
| (15) |
>
|
|
| (16) |
>
|
|
| (17) |
>
|
|
| (18) |
>
|
|
| (19) |
|
|
See Also
|
|
Finance[BrownianMotion], Finance[CEVProcess], Finance[DeterministicProcess], Finance[Diffusion], Finance[Drift], Finance[ExpectedValue], Finance[GaussianShortRateProcess], Finance[GeometricBrownianMotion], Finance[HestonProcess], Finance[OrnsteinUhlenbeckProcess], Finance[PathPlot], Finance[SamplePath], Finance[SquareRootDiffusion], Finance[StochasticProcesses], Finance[ValueAtRisk], Finance[WienerProcess]
|
|
References
|
|
|
Glasserman, P., Monte Carlo Methods in Financial Engineering. New York: Springer-Verlag, 2004.
|
|
Hull, J., Options, Futures, and Other Derivatives, 5th. edition. Upper Saddle River, New Jersey: Prentice Hall, 2003.
|
|
Kloeden, P., and Platen, E., Numerical Solution of Stochastic Differential Equations, New York: Springer-Verlag, 1999.
|
|
|