Skip to content
All library documents

Correct Euler Simulation Steps for the Vasicek Short-Rate Model

Article Quant Q&A · Author: mStudent

Summary

The document compares the analytical mean of the Vasicek short-rate model with a Monte Carlo estimate built by stepping rates forward over a time grid. Its initial update formula includes the mean-reversion drift and a Gaussian shock scaled by volatility and the square root of the time increment, but omits the current rate itself. Consequently, each step returns only an increment rather than the next rate level, producing simulated expectations inconsistent with the analytical formula.

The correction adds the current rate to the drift and shock terms before returning the next value. This is the Euler discretization of the Vasicek dynamics, and it makes the simulation track a rate level through successive steps. The document reports that the corrected simulation brings estimates closer to the exact expectation. It does not discuss sampling error, discretization bias, or the exact transition distribution, so those remain relevant when choosing a simulation method or judging Monte Carlo agreement.

Key ideas

  • A short-rate simulation update must retain the current rate level as well as add the drift and random shock.
  • The Vasicek model combines mean reversion toward a long-run level with Gaussian randomness.
  • Repeated Euler steps can estimate the expected rate at a horizon.
  • Monte Carlo estimates may differ from the analytical mean due to sampling and discretization effects.

Tags

Full text
# time step choice impact in Vasicek model simulations


# time step choice impact in Vasicek model simulations












I am trying to make some computations using Vasicek short rate model. Especially I a trying to compare exact expectation(obtained with the formula) and the expectation from Monte Carlo simulation.

- For Exact computation I use:

$E[r_t] = r_0 * exp(-a*t) + (\theta/a)*(1-exp(-a*t))$

```
 public override double GetExpectation(double r0, double t)
        {
            double expectation = r0 * Math.Exp(-_a * t) + (_theta / _a) * (1 - Math.Exp(-_a * t));
            return expectation;
        }
```

- For Monte Carlo simulations I use the following method: I compute r from a time t to a time t+dt using: public override double ComputeNextValue(double r0, double dt) { RandomVariableGenerator rvg = RandomVariableGenerator.GetInstance(); `double randomGaussian = rvg.GetNextRandomGaussian(); double r_t_dt = (_theta - _a*r0)*dt + _sigma * Math.Sqrt(dt) * randomGaussian; return r_t_dt; ` } then a compute a path from 0 to t with dt as time steps using:

```
double randomGaussian = rvg.GetNextRandomGaussian();
double r_t_dt = (_theta - _a*r0)*dt + _sigma * Math.Sqrt(dt) * randomGaussian;

return r_t_dt;
```

public override double ComputeValue(double r0, double t, double dt) { double x = r0;

```
    for(double slot = dt; slot <= t; slot += dt)
    {
        x = ComputeNextValue(x, dt);
    }
    return x;
}
```

- Then I compute the Monte Carlo Expectation using: public override double ComputeMonteCarloExpectation(double r0, double t, double dt, int nreps) { double sum = 0.0; double value; for (int i = 0; i < nreps; i++) { value = ComputeValue(r0, t, dt); sum += value; } return sum / nreps; }

I use the following parameters:

```
            double sigma = 0.03;
            double r0 = 0.03;
            double theta = 0.1;
            double a = 0.3;

            int nreps = 1000;
            double t = 1;
```

For dt = 0.1: Exact expectation: 0,108618473059879; Monte Carlo Expectation: 0,0101464832161612

For dt = 1: Exact expectation: 0,108618473059879; Monte Carlo Expectation: 0,092058844704742

using dt = 1 leads to a result close to exact value while using dt = 0.1 seems to lead to a result having a 0.1 factor difference with exact one.

I think I am doing something wrong but I can't figure it out. Do you have an idea?

## Answer by mStudent (score 1)

https://quant.stackexchange.com/a/37274

I got help from LutzL and figured out that I forgot to add the r0 term

```
ComputeNextValue(double r0, double dt) 
{ 
RandomVariableGenerator rvg = RandomVariableGenerator.GetInstance();

double randomGaussian = rvg.GetNextRandomGaussian();
double r_t_dt = r0 + (_theta - _a*r0)*dt + _sigma * Math.Sqrt(dt) * randomGaussian;

return r_t_dt;
}
```

It solved the problem and the values are now closer

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.