Simulate multivariate stochastic differential equations (SDEs)
[Paths, Times, Z] = simulate(MDL, ...)
All classes in the SDE Class Hierarchy.
This method simulates any vector-valued SDE of the form:
X is an NVARS-by-
vector of process variables (for example, short rates or equity prices)
W is an NBROWNS-by-
F is an NVARS-by-
G is an NVARS-by-NBROWNS matrix-valued diffusion-rate function.
[Paths, Times, Z] = simulate(MDL, ...) simulates
NVARS correlated state variables, driven
NBROWNS Brownian motion sources of risk over
observation periods, approximating continuous-time stochastic processes.
|Stochastic differential equation model.|
simulate method accepts any variable-length
list of input arguments that the simulation method or function referenced
SDE.Simulation parameter requires or accepts.
It passes this input list directly to the appropriate SDE simulation
method or user-defined simulation function.
Simulation methods allow you to specify a popular variance reduction technique called antithetic sampling. This technique attempts to replace one sequence of random observations with another of the same expected value, but smaller variance.
In a typical Monte Carlo simulation, each sample path is independent and represents an independent trial. However, antithetic sampling generates sample paths in pairs. The first path of the pair is referred to as the primary path, and the second as the antithetic path. Any given pair is independent of any other pair, but the two paths within each pair are highly correlated. Antithetic sampling literature often recommends averaging the discounted payoffs of each pair, effectively halving the number of Monte Carlo trials.
This technique attempts to reduce variance by inducing negative dependence between paired input samples, ideally resulting in negative dependence between paired output samples. The greater the extent of negative dependence, the more effective antithetic sampling is.
This example applies antithetic sampling to a path-dependent
barrier option. Consider a European up-and-in call option on a single
underlying stock. The evolution of this stock's price is governed
by a Geometric Brownian Motion (
GBM) model with
The stock currently trades at 105.
The stock pays no dividends.
The stock volatility is 30% per annum.
The option strike price is 100.
The option expires in three months.
The option barrier is 120.
The risk-free rate is constant at 5% per annum.
The goal is to simulate various paths of daily stock prices, and calculate the price of the barrier option as the risk-neutral sample average of the discounted terminal option payoff. Since this is a barrier option, you must also determine if and when the barrier is crossed.
This example performs antithetic sampling by explicitly setting
Antithetic flag to
and then specifies an end-of-period processing function to record
the maximum and terminal stock prices on a path-by-path basis.
GBM model using the
Perform a small-scale simulation that explicitly returns two simulated paths:
Perform antithetic sampling such that all primary and antithetic paths are simulated and stored in successive matching pairs. Odd paths (1,3,5,...) correspond to the primary Gaussian paths. Even paths (2,4,6,...) are the matching antithetic paths of each pair, derived by negating the Gaussian draws of the corresponding primary (odd) path.
Verify this by examining the matching paths of the primary/antithetic pair:
To price the European barrier option, specify an end-of-period processing function to record the maximum and terminal stock prices. This processing function is accessible by time and state, and is implemented as a nested function with access to shared information that allows the option price and corresponding standard error to be calculated. For more information on using an end-of-period processing function, see Pricing Equity Options.
Simulate 200 paths using the processing function method:
Approximate the option price with a 95% confidence interval:
Ait-Sahalia, Y. “Testing Continuous-Time Models of the Spot Interest Rate.” The Review of Financial Studies, Spring 1996, Vol. 9, No. 2, pp. 385–426.
Ait-Sahalia, Y. “Transition Densities for Interest Rate and Other Nonlinear Diffusions.” The Journal of Finance, Vol. 54, No. 4, August 1999.
Glasserman, P. Monte Carlo Methods in Financial Engineering. New York, Springer-Verlag, 2004.
Hull, J. C. Options, Futures, and Other Derivatives, 5th ed. Englewood Cliffs, NJ: Prentice Hall, 2002.
Johnson, N. L., S. Kotz, and N. Balakrishnan. Continuous Univariate Distributions. Vol. 2, 2nd ed. New York, John Wiley & Sons, 1995.
Shreve, S. E. Stochastic Calculus for Finance II: Continuous-Time Models. New York: Springer-Verlag, 2004.