# Explanation of formula for implied volatility given $\sigma(t)$

If $dS = S\mu dt + S \sigma(t) dW$, then we know that the implied volatility is $\int_0^T \sigma^2(s)/T \ ds$.

However, if $\sigma(t)$ is a piecewise constant function, i.e. constant between $T_1, T_2$ and between $T_2, T_3$, and so on.

Then, according to some lecture notes, the implied vols are

That, I don't quite understand. Where does this formula come from? If $T$ is the expiry, then how can there be a $T_{i+1} > T$? I thought the expiry was the final such $T$ value?

• Regarding "how can there be a $T_{i + 1} > T$. I think you might be confusing two things here. $\left\{ T_i \right\}_{i = 1}^n$ are the nodes of the piecewise constant volatility function of the underlying asset. $T$ is the maturity of the option. The volatility function of the underlying is can be well-defined even when there exist no corresponding option contracts. – LocalVolatility Mar 26 '17 at 16:55

Note that the implied volatility is given by \begin{align*} \hat{\sigma}(T)=\sqrt{\frac{1}{T}\int_0^T \sigma^2(t) dt}, \end{align*} while $\frac{1}{T}\int_0^T \sigma^2(t) dt= \hat{\sigma}^2(T)$ is the implied variance.
For a piecewise constant volatility function $\sigma$, the implied variance for option with maturity $T$, where $T_i \le T \le T_{i+1}$, is given by \begin{align*} \hat{\sigma}^2(T)&=\frac{1}{T}\int_0^T \sigma^2(t) dt \\ &= \frac{1}{T}\left(\int_0^{T_i}\sigma^2(t) dt + \int_{T_i}^T\sigma^2(t) dt \right)\\ &=\frac{1}{T}\left(T_i\, \hat{\sigma}^2(T_i) + (T-T_i)\, \sigma_{i+1}^2\right), \end{align*} where \begin{align*} \hat{\sigma}^2(T_i) = \frac{1}{T_i}\int_0^{T_i}\sigma^2(t) dt \end{align*} is the implied variance for option with maturity $T_i$.