# compute the risk-neutral expected variance

The formula (3.8) on page 30 of the book THE VOLATILITY SURFACE by Gatheral(2006) introduces a method for computing the expected variance under the risk neutral measure. By denoting $x_t = log(S_t/S_0)$, and $q(x_t,t;x_T,T)$ and $\sigma^2_{loc}(x_t,t)$ represent the $pdf$ of $x_t$ and local variance, respectively:
$$E[\sigma^2_{K,T}(t)]= \int dx_t\cdot q(x_t,t;x_T,T) \cdot \sigma^2_{loc}(x_t,t)$$

I use this formula to compute the expected variance and it can return the negative value. My approach is:

1. simulate a sequence of $x_t$;

2. use my function to compute $q(x_t,t;x_T,T)$ for each point of $x_t$ and they are positive;

3. generate a sequence of local variance which are positive;

4. integrate from $0$ to each point of $x_t$.Then, I get a sequence of expected variance. When $x_t$ is negative, then the integrated result is negative. How can I overcome this problem?

Thank you!

• It is not clear what you are trying to achieve here IMHO. Am I right to believe that you are trying to use the "most-likely path approximation" to calculate the implied BS volatility from a local volatility surface and an input Gamma kernel $q(x_t,t;x_T;T,K)$? – Quantuple Dec 6 '16 at 15:55
• @Quantuple I am going to compute the expected variance using this formula. This variance is one parameter of my model, but it is not implied variance. Is this formula only for computing BS volatility? Yes, you are right about $q(\cdot)$. – smirk Dec 6 '16 at 16:10
• Expected variance can mean anything. Expected variance of what? If it is the expected realised variance of log-returns you are looking for why not have a look at how to price variance swaps? Otherwise yes the MLP approximation proposed by Gatheral is used to infer BS implied volatilities as far as I can remember. – Quantuple Dec 6 '16 at 16:25