simByMilstein
Simulate BM
, GBM
, CEV
,
HWV
, SDEDDO
, SDELD
,
SDEMRD
sample paths by Milstein approximation
Since R2023a
Description
[
simulates Paths
,Times
,Z
] = simByMilstein(MDL
,NPeriods
)NTrials
sample paths of NVARS
state
variables driven by the BM
, GBM
,
CEV
, HWV
, SDEDDO
,
SDELD
, or SDEMRD
process sources of risk
over NPeriods
consecutive observation periods, approximating
continuous-time by the Milstein method.
simByMilstein
provides a discrete-time approximation of the
underlying generalized continuous-time process. The simulation is derived directly
from the stochastic differential equation of motion; the discrete-time process
approaches the true continuous-time process only in the limit as
DeltaTimes
approaches zero.
[
specifies options using one or more name-value pair arguments in addition to the
input arguments in the previous syntax.Paths
,Times
,Z
] = simByMilstein(___,Name=Value
)
You can perform quasi-Monte Carlo simulations using the name-value arguments for
MonteCarloMethod
, QuasiSequence
, and
BrownianMotionMethod
. For more information, see Quasi-Monte Carlo Simulation.
Examples
Input Arguments
Output Arguments
More About
Algorithms
This function simulates any vector-valued SDE of the form
where:
X is an NVars-by-
1
state vector of process variables (for example, short rates or equity prices) to simulate.W is an NBrowns-by-
1
Brownian motion vector.F is an NVars-by-
1
vector-valued drift-rate function.G is an NVars-by-NBrowns matrix-valued diffusion-rate function.
simByEuler
simulates NTrials
sample
paths of NVars
correlated state variables driven by
NBrowns
Brownian motion sources of risk over
NPeriods
consecutive observation periods, using the Euler
approach to approximate continuous-time stochastic processes.
This simulation engine provides a discrete-time approximation of the underlying generalized continuous-time process. The simulation is derived directly from the stochastic differential equation of motion. Thus, the discrete-time process approaches the true continuous-time process only as
DeltaTime
approaches zero.The input argument
Z
allows you to directly specify the noise-generation process. This process takes precedence over theCorrelation
parameter of thesde
object and the value of theAntithetic
input flag. If you do not specify a value forZ
,simByEuler
generates correlated Gaussian variates, with or without antithetic sampling as requested.The end-of-period
Processes
argument allows you to terminate a given trial early. At the end of each time step,simByEuler
tests the state vector Xt for an all-NaN
condition. Thus, to signal an early termination of a given trial, all elements of the state vector Xt must beNaN
. This test enables a user-definedProcesses
function to signal early termination of a trial, and offers significant performance benefits in some situations (for example, pricing down-and-out barrier options).
References
[1] Milstein, G.N. "A Method of Second-Order Accuracy Integration of Stochastic Differential Equations."Theory of Probability and Its Applications. 23, 1978, pp. 396–401.
Version History
Introduced in R2023a