# simByEuler

Euler simulation of stochastic differential equations (SDEs) for
`SDE`

, `BM`

, `GBM`

,
`CEV`

, `CIR`

, `HWV`

,
`Heston`

, `SDEDDO`

, `SDELD`

, or
`SDEMRD`

models

## Description

`[`

specifies options using one or more name-value pair arguments in addition to the
input arguments in the previous syntax.`Paths`

,`Times`

,`Z`

] = simByEuler(___,`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

$$d{X}_{t}=F(t,{X}_{t})dt+G(t,{X}_{t})d{W}_{t}$$

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 the`Correlation`

parameter of the`sde`

object and the value of the`Antithetic`

input flag. If you do not specify a value for`Z`

,`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*X*for an all-_{t}`NaN`

condition. Thus, to signal an early termination of a given trial, all elements of the state vector*X*must be_{t}`NaN`

. This test enables a user-defined`Processes`

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] Deelstra, G. and F. Delbaen.
“Convergence of Discretized Stochastic (Interest Rate) Processes with Stochastic
Drift Term.” *Applied Stochastic Models and Data Analysis*,
1998, Vol. 14, No. 1, pp. 77–84.

[2] Higham, Desmond, and Xuerong
Mao. “Convergence of Monte Carlo Simulations Involving the Mean-Reverting Square Root
Process.” *The Journal of Computational Finance*, Vol. 8, No. 3,
2005, pp. 35–61.

[3] Lord, Roger, et al. “A
Comparison of Biased Simulation Schemes for Stochastic Volatility Models.”
*Quantitative Finance*, Vol. 10, No. 2, Feb. 2010, pp.
177–94

## Version History

**Introduced in R2008a**

## See Also

`simByMilstein`

| `simByMilstein2`

| `simByTransition`

| `simBySolution`

| `simBySolution`

| `simByHybrid`

| `simByQuadExp`

| `simulate`

| `sde`

| `bm`

| `gbm`

| `sdeddo`

| `sdeld`

| `cev`

| `cir`

| `heston`

| `hwv`

| `sdemrd`

### Topics

- Implementing Multidimensional Equity Market Models, Implementation 5: Using the simByEuler Method
- Simulating Equity Prices
- Simulating Interest Rates
- Stratified Sampling
- Price American Basket Options Using Standard Monte Carlo and Quasi-Monte Carlo Simulation
- Base SDE Models
- Drift and Diffusion Models
- Linear Drift Models
- Parametric Models
- SDEs
- SDE Models
- SDE Class Hierarchy
- Quasi-Monte Carlo Simulation
- Performance Considerations