Skip to content
All library documents

Exact Log-Price Simulation for a Mean-Reverting GBM

Article Quant Q&A · Author: Pam

Summary

The question asks how to simulate the next price in a geometric mean-reverting model from the previous price, elapsed time, drift, reversion speed, volatility, and a standard normal draw. The accepted answer gives a discrete transition: evolve the log price toward the log of a long-run equilibrium price at an exponential rate, then add a normally distributed shock whose variance depends on the time step and reversion speed. Exponentiating the updated log price gives the simulated price. The example uses this transition recursively and identifies maximum likelihood as one possible calibration approach.

The answer’s displayed transition does not include the question’s separate drift parameter; drift must be handled consistently with the chosen model specification. The formula also requires a positive reversion speed for the stated variance expression and an equilibrium price to define the long-run mean. The discussion cautions that parameter estimation and model choice depend on the data, and that adding jumps increases calibration complexity. A second response notes that reversion speed controls sensitivity to deviations from the mean.

Key ideas

  • The transition evolves log price toward the log of an equilibrium price at an exponential rate.
  • The shock variance is scaled by the elapsed time and the mean-reversion speed.
  • Exponentiating the updated log price converts the simulated log value back into a price.
  • The displayed formula omits the separate drift parameter requested in the question.
  • Maximum likelihood is mentioned as one possible method for estimating model parameters.

Tags

Full text
# Getting the next price of a GBM with reversion


# Getting the next price of a GBM with reversion












Here is the "twin" question of Getting the next price of a GBM (Geometric Brownian Motion) but for GBM with reversion

As in that case, I'd like to write a formula for the next price, as function of:

```
-PreviousPrice
-DayElapsed    (this can be any fraction, however small, of a day)
-Drift         (daily drift = annual drift% / 100 / 250)
-ReversionSpeed
-Volatility   (daily volatility = annual volatility% / 100 / sqrt(250))
-N01  (standard normal realization)
```

I got from a site this stuff (which seems a bit too involved for my taste):

```
 expTerm1 = Exp(ReversionSpeed * DayElapsed)
 Term1   = Log(PreviousPrice) * expTerm1

 OneMinusexpTerm1   = (1 + expTerm1)
 Term2 = (Log(InitialPrice) - Drift  / ReversionSpeed ) * OneMinusexpTerm1      

 OneMinus_expTerm_2   = 1 - (expTerm1 * expTerm1)
 Term3   = (Volatility * Volatility ) * OneMinus_expTerm_2 / (4 * ReversionSpeed )
 Term4   = Volatility * N01  * Sqrt(OneMinus_expTerm_2 / (2 * ReversionSpeed))

 NextPrice = Math.Exp(Term1 + Term2 + Term3 + Term4)
```

Could you kindly a better expression (or appropriate corrections to the above) **using my notation and parameters above (assumed <> 0) ** (and/or any useful integration, of course) ?

(The source for my "attempt" above is: http://marcoagd.usuarios.rdc.puc-rio.br/sim_stoc_proc.html#mc-mrd but I am not sure if I got this right.)

P.S. I just want to get 1 preliminary implementation, using all the above parameters (those are constants specified by the user)(volatility, drift, reversion speed, reversion price or "mean"). One of your own choice would do. I am NOT after modeling any instrument in particular, at this time. Will see later the conceptual variations. It's just for testing my software interface. (Later will focus on other concepts). Thank you

## Answer by Lucas Morin (score 4)

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

The formula is given in your link. For the real world probability without jump:

$$x_t = x_{t-1} e^{-\eta \Delta t} + \hat{x}(1-e^{-\eta \Delta t}) +\sigma \sqrt{\frac{1-e^{- 2 \eta \Delta t}}{2 \eta}} N(0,1) $$

where:

$x_t$: price

$x_{t-1}$: PreviousPrice

$\hat{x}$: long term mean (a parameter)

$\Delta t$: Time step (one fraction)

$\eta$: ReversionSpeed

$\sigma$: Volatility (daily volatility = annual volatility% / 100 / 250)

$N(0,1)$: Standard normal realisation

Here is an R implementation:

```
set.seed(1) # Initialize the random number generation

ReversionSpeed=0.1 #parameter
Timestep=1 
Volatility =0.1 
T = 50 # number of timesteps
x=0.5 #initial price
EquilibriumPrice=0.4 #equilibrium price

for (i in 1:T){
  PreviousPrice = x[i-1]  
  N01 = rnorm(1,0,1)
  NextPrice = exp(log(PreviousPrice) * exp(-ReversionSpeed * Timestep) + log(EquilibriumPrice) * (1 - exp(-ReversionSpeed * Timestep))  + Volatility * N01  * sqrt((1 - (exp(-2*ReversionSpeed * Timestep))) / (2 * ReversionSpeed))) 
  x=rbind(x,NextPrice)
}

plot(x)
```

Using these notation you should be able to deduce the risk neutral simulation.

As you can see it, I have given the parameters some values. In practice you should find the parameters that correspond to your asset. This is not easy. This process is Called Calibration. You can look at the most common methods: Maximum likelihood estimation. This is an optimisation technique: given the recursive equation (the equation above) you find the theoretical distribution in function of the parameters, you then try to find the sets of parameters which is the most likely to give prices previously observed.

If you want my opinion on models in general: It really depends on your data as models have evolved to fit specific datasets. But You need to choose the model first, not fitting a model to your dataset. (this imply you have to learn about models).

Models with jumps are used to take into account the fact that price distribution are heavy tailled. It is easy to consider them better than a model without jumps on the paper, but they are way more difficult to use in practice (specifficaly the calibration part, this imply you should learn about Calibration).

If you reaaly want to use these complex tools without learning about models and ways to use them in practice (I do not recommend that) you should look at libraries for common languages as you won't be able to implement the models and methods easily. I suggest you to use R and its packages.

## Answer by emcor (score 3)

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

1) The reversion speed $\eta$ is just a scaling factor >0 to control the sensitivity to mean deviations, it has no unit as such.

2) There are various simulation formulas in your reference link. Can you please specify which of these you want to simulate?

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.