Skip to content
All library documents

Computing Conditional Variance for a Mean-Reverting Square-Root SDE

Article Quant Q&A · Author: pisopapir

Summary

The document explains two general ways to obtain the variance of a stochastic differential equation: calculate the first and second moments and subtract the squared mean, or derive cumulants from the cumulant generating function. It then works through the moment approach for a mean-reverting square-root process with constant long-run mean, the same process family used in CIR interest-rate and Heston volatility models.

An exponential change of variables removes the linear mean-reversion drift. Applying Itô’s formula to the transformed process and its square gives expressions for the first and second moments, which combine into a closed-form variance conditional on the starting value. The derivation is useful for this specific process and illustrates a broader moment method. Its formulas assume the stated square-root dynamics and constant parameters; the answer omits explicit conditioning notation and does not treat more general SDEs.

Key ideas

  • Variance can be found from the first two moments or from the second cumulant.
  • An exponential transformation simplifies the drift in the stated square-root process.
  • Itô’s formula applied to the transformed process and its square yields the moments.
  • The resulting variance depends on the initial state, mean-reversion speed, volatility, and elapsed time.
  • The derivation applies to the specified process rather than arbitrary SDEs.

Tags

Full text
# How do you find variance of a sde?


# How do you find variance of a sde?












I know how to find the mean of an SDE: write it on integral form, take derivative, solve a simple ODE.

But what to do when we want a variance?

In my case, $$X_{T + \delta t} = X_T + \int_T^{T + \delta t} \lambda ( 1 -X)dt + \int_T^{T + \delta t} \sigma \sqrt{X} dW$$ and I want the variance, conditional on $X_T$.

Is there a simple approach?

## Answer by LocalVolatility (score 7)

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

Here are two approaches that you could take to compute the variance of $X_t$. I am not making the conditioning explicit as it just complicates the notation but doesn't really add any additional insights.

- Compute $\mathbb{E} \left[ X_t \right]$ and $\mathbb{E} \left[ X_t^2 \right]$. You can then you use that \begin{equation} \text{Var} \left( X_t \right) = \mathbb{E} \left[ X_t^2 \right] - \mathbb{E} \left[ X_t \right]^2. \end{equation}

- Compute the cumulant generating function \begin{equation} \psi_{X_t}(\omega) = \ln \left( \mathbb{E} \left[ e^{\mathrm{i} \omega X_t} \right] \right). \end{equation} Then use that the $n$-th cumulant is linked to the $n$-th derivative of the cumulant generating function at $\omega = 0$ \begin{equation} c_n \left( X_t \right) = \frac{1}{\mathrm{i}^n} \frac{\partial^n}{\partial \omega^n} \psi_{X_t}(0). \end{equation} The first two cumulants are equal to the mean and variance, respectively.

In what follows, I am working out the first approach. In your case, the dynamics of $X$ are given by

\begin{equation} \mathrm{d}X_t = \lambda \left( 1 - X_t \right) \mathrm{d}t + \sigma \sqrt{X}_t \mathrm{d}W_t. \end{equation}

Note that this is a special case of a square-root process with mean reversion speed $\lambda$ and a long-term mean of one. The solution here is thus a special case of the more general solution given e.g. in the context of the Cox-Ingersoll-Ross interest rate model or the Heston stochastic volatility model.

First, we remove the geometric drift term $-\lambda X_t \mathrm{d}t$ by setting $Y_t = e^{\lambda t} X_t$. Its differential is given by

\begin{eqnarray} \mathrm{d}Y_t & = & \lambda e^{\lambda t} X_t \mathrm{d}t + e^{\lambda t} \mathrm{d}X_t\\ & = & \lambda e^{\lambda t} \mathrm{d}t + \sigma e^{\lambda t} \sqrt{X_t} \mathrm{d}W_t\\ & = & \lambda e^{\lambda t} \mathrm{d}t + \sigma e^{\lambda t / 2} \sqrt{Y_t} \mathrm{d}W_t. \end{eqnarray}

Integrating yields

\begin{eqnarray} Y_t & = & Y_0 + \lambda \int_0^t e^{\lambda u} \mathrm{d}u + \sigma \int_0^t e^{\lambda u / 2} \sqrt{Y_u} \mathrm{d}W_u\\ & = & Y_0 + e^{\lambda t} - 1 + \sigma \int_0^t e^{\lambda u / 2} \sqrt{Y_u} \mathrm{d}W_u. \end{eqnarray}

Since $\mathbb{E} \left[ X_t \right] = e^{-\lambda t} \mathbb{E} \left[ Y_t \right]$, we conclude that

\begin{equation} \mathbb{E} \left[ X_t \right] = e^{-\lambda t} X_0 + \left( 1 - e^{-\lambda t} \right). \end{equation}

Next, we compute the differential of $Y_t^2$ and get

\begin{eqnarray} \mathrm{d} Y_t^2 & = & 2 Y_t \mathrm{d}Y_t + \mathrm{d} \langle Y \rangle_t\\ & = & 2 \lambda e^{\lambda t} Y_t \mathrm{d}t + 2 \sigma e^{\lambda t / 2} Y_t \sqrt{Y_t} \mathrm{d}W_t + \sigma^2 e^{\lambda t} Y_t \mathrm{d}t. \end{eqnarray}

Integrating again gives

\begin{equation} Y_t^2 = Y_0^2 + \left( 2 \lambda + \sigma^2 \right) \int_0^t e^{\lambda u} Y_u \mathrm{d}u + 2 \sigma \int_0^t e^{\lambda u / 2} Y_u \sqrt{Y_u} \mathrm{d}W_u. \end{equation}

The expectated value is

\begin{eqnarray} \mathbb{E} \left[ Y_t^2 \right] & = & Y_0^2 + \left( 2 \lambda + \sigma^2 \right) \int_0^t e^{\lambda u} \mathbb{E} \left[ Y_u \right] \mathrm{d}u\\ & = & Y_0^2 + \left( 2 \lambda + \sigma^2 \right) \int_0^t e^{\lambda u} \left( Y_0 + e^{\lambda u} - 1 \right) \mathrm{d}u\\ & = & Y_0^2 + \left( 2 \lambda + \sigma^2 \right) \left( \frac{1}{\lambda} \left( Y_0 - 1 \right) \left( e^{\lambda t} - 1 \right) + \frac{1}{2 \lambda} \left( e^{2 \lambda t} - 1 \right) \right) \end{eqnarray}

Since $\mathbb{E} \left[ X_t^2 \right] = e^{-2 \lambda t} \mathbb{E} \left[ Y_t^2 \right]$, we get

\begin{eqnarray} \mathbb{E} \left[ X_t^2 \right] & = & e^{-2 \lambda t} X_0^2 + \left( 2 \lambda + \sigma^2 \right) \left( \frac{1}{\lambda} \left( X_0 - 1 \right) \left( e^{-\lambda t} - e^{-2 \lambda t} \right) + \frac{1}{2 \lambda} \left( 1 - e^{-2 \lambda t} \right) \right)\\ & = & e^{-2 \lambda t} X_0^2 + 2 X_0 \left( e^{-\lambda t} - e^{-2 \lambda t} \right) + \frac{\sigma^2}{\lambda} X_0 \left( e^{-\lambda t} - e^{-2 \lambda t} \right)\\ & & + \left( 1 - e^{-\lambda t} \right)^2 + \frac{\sigma^2}{2 \lambda} \left( 1 - e^{-\lambda t} \right)^2. \end{eqnarray}

Since

\begin{eqnarray} \left( \mathbb{E} \left[ X_t \right] \right)^2 = e^{-2 \lambda t} X_0^2 + 2 X_0 \left( e^{-\lambda t} - e^{-2 \lambda t} \right) + \left( 1 - e^{-\lambda t} \right)^2, \end{eqnarray}

it follows that the variance of $X_t$ is given by

\begin{equation} \text{Var} \left( X_t \right) = \frac{\sigma^2}{\lambda} X_0 \left( e^{-\lambda t} - e^{-2 \lambda t} \right) + \frac{\sigma^2}{2 \lambda} \left( 1 - e^{-\lambda t} \right)^2. \end{equation}

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.