The other answers have given a good qualitative description of what the VIX measures. In this answer, I will try to give a comprehensive quantitative overview of how the VIX formula works.
What is the VIX?
The CBOE Volatility Index (VIX) is an index which measures the stock market’s expectation of the future 30-day volatility of the S&P-500 index. This is done using prices of S&P-500 index options.
What does the VIX measure exactly?
It is usually assumed in financial mathematics that the price of an asset, such as a stock or the S&P 500, follows an Itô diffusion process with drift $\mu$ and volatility $\sigma$. (For more information on the mathematical background, see Definition 2 below.) Informally, $\mu$ and $\sigma$ have two important properties: They depend on time $t\in[0,\infty[$ (where $t=0$ corresponds to the current trading time), and at each fixed time $t$, they are a random variable. The VIX wants to determine how large the future volatility of the S&P-500 index will be [Footnote 1]. More specifically, the VIX wants to determine
$$
\lVert\sigma\rVert_{L^2([0,T])}^2=\int_0^T \sigma_s^2\,\mathrm ds,
$$
where $T>0$ is some time horizon in the future (for the VIX, $T=30\text{ days}$ is used).
$\lVert\sigma\rVert_{L^2([0,T])}^2$ is the average of the volatility squared over the next time period of length $T$. Intuitively you may think about it as a measure for the average volatility of the market in the next 30 days.
However, $\lVert\sigma\rVert_{L^2([0,T])}^2$ is a random variable and its value is only determined at time $T$ [Footnote 2]. But we want a number now, not at time $T$.
The fundamental Theorem of asset pricing
There is a similar problem for pricing options: An option, such as a call or a put, gives you a pre-defined payoff at some time $T>0$ which depends on the future price of an underlying asset, such as a stock or an index. However, the future price of the asset is usually only determined at time $T$. So how do we price the option at time $0$ ?
The answer is given by the Fundamental Theorem of Asset Pricing, which allows to give a fair price to any (attainable) contingent claim in the market. Here, a contingent claim is an $\mathcal F_T$-measurable random variable with sufficient integrability (see [2; Page 230] for more details). Intuitively, one should think of a contingent claim as a financial product which gives some pre-defined payoff at time $T$, however, this payoff depends on the asset prices at time $T$, and is therefore only determined at time $T$. For example, calls and puts can be modeled as contingent claims.
As proven for instance by Delbaen & Schachermayer (1994), under certain assumptions on a financial market, such as there not being any arbitrage opportunities (see for example [2; Theorem 4.4.1] and [2; Theorem 6.1.2 and the following remarks]), there exists a probability measure $\hat{\mathsf P}$ which is equivalent to $\mathsf P$ (i.e. both measures have the same null sets) such that the price of any contingent claim $X$ at time $t\in[0,T]$ is given by the formula (cf. [2; Theorem 6.1.4] and [Footnote 5])
$$
B_t\hat{\mathsf E}\left(\frac{X}{B_T}\middle\vert\mathcal F_t\right),
$$
where $\hat{\mathsf E}$ is the expectation with respect to $\hat{\mathsf P}$ and $B$ is a stochastic process called the numéraire. $B$ is the asset which is used to price all the other assets. (It must be noted that $\hat{\mathsf P}$ depends on $B$, cf. [2; Page 24] and [Footnote 3].) $B$ can be chosen equal to any asset [Footnote 3] which is strictly positive, however it is usual to choose $B$ equal to the price process of one USD invested into risk-free short-term bonds or a money market account.
This is what we will do. We furthermore assume that the risk-free rate over the next 30 days is constant and equal to $R$ [Footnote 4]. Then the numéraire $B_t$ satisfies $B_t=\exp(Rt)\text{USD}$.
In particular, the fair price (in USD) at the current trading moment for a contingent claim $X$ which expires at time $T$ is
$$
\exp(-RT)\hat E(X).
$$
The forward price
We need one more concept to finish the explanation of the VIX, namely the forward price.
The forward price of an asset with price process $(S_t)_{t\in[0,\infty[}$ is defined as the price at which a synthetic long asset position (i.e., buying an at-the-money call and selling an at-the-money put) would break even at expiration.
Recall that upon expiry, a put with strike $K$ on an asset with price $s$ at the expiry date returns
$$
\max(0,K-s),
$$
while a ceteris paribus call returns
$$
\max(0, s-K).
$$
A synthetic long position on the asset thus returns on expiry
$$
\max(0,s-K)-\max(0,K-s).
$$
If $p(K)$ denotes the price of a Put today with strike $K$ and expiry at $T$ on the stock or asset, and $c(K)$ is analogous for the price of the Call, then we pay
$$
c(K)-p(K)
$$
today in order to open a synthetic long position. Thus, the $T$-forward price of a financial asset is defined as the $s$ such that (recall that in our case $B_T=B_0=1$ and that “having one $B_0$ today” leads to “having one $B_T$ at time $T$” if one chooses to invest all of one’s money into the numéraire)
$$
\frac{\max(0,s-K)-\max(0,K-s)}{B_T}=\frac{c(K)-p(K)}{B_0}.
$$
TODO: Review this section. In particular, check the Definitions, add references, and motivate the Definition of the forward price.
The price of future volatility
Recall that the VIX wants to determine $\lVert\sigma\rVert_{L^2([0,T])}^2$, which was, unfortunately, a random variable whose value is only determined at time $T$. However, armed with the fundamental Theorem of asset pricing, we could define the VIX at the current trading moment as the fair price that one has to pay now in order to receive $\lVert\sigma\rVert_{L^2([0,T])}^2$ at time $T$. The fair price for $\lVert\sigma\rVert_{L^2([0,T])}^2$ at the current trading moment would be
$$
\exp(-RT)\hat{\mathsf E}(\lVert\sigma\rVert_{L^2([0,T])}^2).
$$
However, for some reason unclear to me, the VIX measures the undiscounted fair price of the future volatility. In other words, the VIX is defined as the fixed price that one would have to agree on today but only pay at time $T$ in exchange for receiving $\lVert\sigma\rVert_{L^2([0,T])}^2$ at time $T$ (note that this is what a variance swap does, as we will see below). Therefore, the current value of the VIX is defined as
$$
\hat{\mathsf E}(\lVert\sigma\rVert_{L^2([0,T])}^2).
$$
Digression: Variance Swaps
It may be remarked that, in the real world, there is indeed a financial derivative, called variance swap, paying $\lVert\sigma\rVert_{L^2([0,T])}^2-K$ at time $T$, where $K$ is a strike price that is fixed today. As we have already determined, the swap is fair if only if $K=\hat{\mathsf E}(\lVert\sigma\rVert_{L^2([0,T])}^2)$. This $K$ is the fair strike for a variance swap. Note in particular that the current value of $K$ is $\exp(-RT)\hat{\mathsf E}(\lVert\sigma\rVert_{L^2([0,T])}^2)$, which is indeed the fair price to be paid today for receiving $\lVert\sigma\rVert_{L^2([0,T])}^2$ at time $T$.
Furthermore, there are other financial instruments, such as volatility swaps, which pay $\lVert\sigma\rVert_{L^2([0,T])}$ instead. See [A] for a fairly comprehensive overview.
End of digression
One problem is that, while the existence of $\hat P$ is guaranteed, there is no general way to compute it explicitly. So how can we compute $\hat{\mathsf E}(\lVert\sigma\rVert_{L^2([0,T])}^2)$ ?
This is answered by what I find the most ingenious part of the idea behind VIX: It turns out that a variance swap can be hedged using calls and puts. By the condition of there being no arbitrage, one can therefore compute the fair price of a variance swap from the fair price of puts and calls. And this price is already known, since Puts and Calls already have prices attached to them by Black-Scholes or by the market. More specifically, let $F$ be the $T$-forward price of the S&P-500 and let $p(K), c(K)$ be as in the previous section. Then one can show that under appropriate assumptions on the Itô price processes, in particular that there is a risk-free price process with fixed interest rate $R$ for the next thirty days [Footnote 4] (calculatory details can be found in [3]), we have TODO: Explain details; explain when the integrals converge
$$
\hat{\mathsf E}(\lVert\sigma\rVert_{L^2([0,T])}^2)= \frac{2}{T}\ln\frac{F}{S^{*}} - \frac{2}{T}\left( \frac{F}{S^{*}}-1\right) +\frac{2}{T}\left(\int_{0}^{S^*} \frac{1}{K^{2}}e^{RT}p(K)\,\mathrm dK + \int_{S^*}^{\infty} \frac{1}{K^{2}}e^{RT}c(K)\,\mathrm dK\right).
$$
for any $S^*\in]0,\infty[$. TODO: Check if this is right.
It is now convenient to choose $S^*=F$, which leads to
$$
\hat{\mathsf E}(\lVert\sigma\rVert_{L^2([0,T])}^2)= \frac{2e^{RT}}{T}\left(\int_{0}^{F} \frac{1}{K^{2}}p(K)\,\mathrm dK + \int_{F}^{\infty} \frac{1}{K^{2}}c(K)\,\mathrm dK\right).
$$
FInally, it was decided that, in order for the VIX to scale like the volatility $\sigma$ and not like the variance $\sigma^2$, we take the square root of the whole thing. And this indeed gives us the formula with which the VIX is computed:
$$
\text{VIX}\overset{\text{Def.}}=\sqrt{\hat{\mathsf E}(\lVert\sigma\rVert_{L^2([0,T])}^2)}=\sqrt{ \frac{2e^{RT}}{T}\left(\int_{0}^{F} \frac{1}{K^{2}}p(K)\,\mathrm dK + \int_{F}^{\infty} \frac{1}{K^{2}}c(K)\,\mathrm dK\right)}.
$$
TODO: Expand answer by including practical ways to compute this (there are only finitely many Puts or Calls in the real world).
The underlying mathematical framework
Throughout the whole text, we assume that we are on a probability space $(\Omega, \mathcal F, \mathsf P)$, together with a filtration $\mathbb F=(\mathcal F_t)_{t\in[0,\infty[}$ satisfying the usual conditions. This means that (cf. also [1; Definition 21.22])
- $\mathbb F=\left(\bigcap_{s>t}\mathcal F_s\right)_{t\in[0,\infty[}$ and
- $\mathcal F_0$ is $\mathsf P$-complete, in other words, if $A\in\mathcal F_0$ and $\mathsf P(A)=0$, then for all $B\subset A$, we have $B\in\mathcal F_0$.
We furthermore assume that $\mathcal F_0$ is trivial, i.e. that $\mathsf P(A)\in\{0,1\}$ for all $A\in\mathcal F_0$.
Definition 1 ([1; Definition 25.5, (ii)]). A stochastic process $X=(X_t)_{t\in[0,\infty[}$ with values in a Polish space (i.e. a completely metrizable, separable topological space) is called progressively measurable iff, for every $t\ge 0$, the map
$$
\Omega\times[0,t]\to E,\\(\omega, s)\mapsto X_s(\omega)
$$
is $\mathcal F_t\otimes\mathcal B([0,t])-\mathcal B(E)$-measurable, where $\mathcal B$ denotes the Borel-measurable sets.
Exercice: Proof that if $X$ is progressively measurable, then $(\omega, t)\mapsto X_t(\omega)$ is $\mathcal F\otimes\mathcal B([0,\infty[)-\mathcal B(E)$-measurable.
Definition 2 ([1; Definition 25.23]). Let $W=(W_t)_{t\in[0,\infty[}$ be a standard Brownian motion with respect to $(\mathbb F,\mathsf P)$ (cf. for example [1; Definition 21.8]). Let $\mathfrak S=(\mathfrak S_t)_{t\in[0,\infty[}$ and $b=(b_t)_{t\in[0,\infty[}$ be progressively measurable stochastic processes (see Definition 1) such that for all $t\ge0$, we have, almost surely,
$$
\int_0^t\mathfrak S_s^2+\lvert b_s\rvert\,\mathrm ds<\infty.
$$
Then the stochastic process
$$
X_t = X_0+\int_0^t\mathfrak S_s\,\mathrm dW_s+\int_0^t b_s\,\mathrm ds
$$
is called an Itô diffusion process.
Note that we will use this Definition also when the time interval $[0,\infty[$ is replaced by a bounded time interval of the form $[0,T]$ for some $T>0$.
Note that, for financial assets, one usually furthermore assumes that the price process $S=(S_t)_{t\in[0,\infty[}$ is a strong solution in the sense of [1; Definition 26.1] of the stochastic differential equation
$$
\mathrm dS_t = \sigma_tS_t\,\mathrm dW_t+\mu_t S_t\,\mathrm dt
$$
for sufficiently regular TODO: make more precise stochastic processes $\mu=(\mu_t)_{t\in[0,\infty[}$ and $\sigma=(\sigma_t)_{t\in[0,\infty[}$. In particular,
$$
S_t = S_0+\int_0^tS_s\sigma_s\,\mathrm dW_s+\int_0^tS_s\mu_s\,\mathrm ds,
$$
so that $S$ is indeed an Itô diffusion process with $\mathfrak S_s=S_s\sigma_s$ and $b_s=S_s\mu_s$. (Compare also with [1; Bemerkung 26.2].)
We will call $\mu$ the drift and $\sigma$ the volatility of the stochastic process $S$ (note that this is a slight abuse of language since drift and volatility have a different meaning for general Itô diffusion processes in the literature, namely, they usually denote $b$ and $\mathfrak S$, respectively.)
About changing the measure
(This section is based on currently non-public lecture notes by Dylan Possamaï for a course on mathematical finance. I will update it with precise references if the lecture notes are published. For now, I will insert [RefN] where a precise reference is needed.)
TODO: Update this part for non-zero interest rate.
For simplicity I will assume that the interest rate is zero (which is very close to the truth for 30 day interest rates).
If there is no arbitrage [RefN], then there always exists an $\mathbb F$-predictable stochastic process $\lambda$ such that
$$
\mathfrak S_s(\omega)\lambda_s(\omega)=b_s(\omega)
$$
for $\mathrm dt\otimes\mathsf P$-almost all $(s,\omega)\in[0,T]\times\Omega$.
We will assume that
$$
Z_t\overset{\text{Def.}}=\exp\left(-\int_0^t\lambda_s\,\mathrm dW_s-\frac12\int_0^t\lambda_s^2\,\mathrm ds\right), \quad t\in[0,T]
$$
is well-defined and an $(\mathbb F,\mathsf P)$-martingale. In fact, if $Z_t$ is well-defined and an $(\mathbb F,\mathsf P)$-martingale, then it follows that there is no arbitrage in the market (up to time $T$).
In this case, we can prove that the measure $\mathsf Q$ given by $\frac{\mathrm d\mathsf Q}{\mathrm d\mathsf P}=Z_T$ is an equivalent (local) martingale measure for the financial market up to time horizon $T$:
By Girsanov's Theorem [RefN], the stochastic process $(W^{\mathsf Q}_t)_{t\in[0,T]}$ given by
$$
W_t^{\mathsf Q}=W_t+\int_0^t\lambda_s\,\mathrm ds
$$
is an $(\mathbb F,\mathsf Q)$-Brownian motion (up to to time $T$).
Therefore, for any progressively measurable stochastic process $\mathfrak S=(\mathfrak S)_{s\in[0,T]}$ with $\mathsf E^{\mathsf P}\left(\int_0^T\mathfrak S_s^2\,\mathrm ds\right)<\infty$ and $t\in[0,T]$, we have
$$
\int_0^t \mathfrak S_s\,\mathrm dW_s=\int_0^t \mathfrak S_s\,\mathrm d\left(W_s^{\mathsf Q}-\int_0^s\lambda_\tau\,\mathrm d\tau\right)=\int_0^t\mathfrak S_s\,\mathrm dW_s^{\mathsf Q}-\int_0^t\mathfrak S_s\lambda_s\,\mathrm ds,
$$
where the associativity of the stochastic integral [RefN] was used in the last equality.
Therefore, if the price process $(S_t)_{t\in [0,T]}$ is an Itô process
$$
S_t = S_0+\int_0^tb_s\,\mathrm ds+\int_0^t\mathfrak S_s\,\mathrm dW_s,
$$
then
$$
S_t=S_0+\int_0^t\mathfrak S_s\,\mathrm dW_s^{\mathsf Q}-\int_0^t\mathfrak S_s\lambda_s\,\mathrm ds+\int_0^tb_s\,\mathrm ds=S_0+\int_0^t\mathfrak S_s\,\mathrm dW_s^{\mathsf Q}.
$$
Furthermore, by the regularity assumed on $\mathfrak S_s$, the stochastic integral $\int_0^t\mathfrak S_s\,\mathrm dW_s^{\mathsf Q}$ is an $(\mathbb F,\mathsf Q)$-martingale [RefN] [Footnote 6]. This shows two things:
- $\mathsf Q$ is an equivalent martingale measure for the market consisting only of the security with price process $S$.
- The volatility term of $S_t$ remains unchanged when we go from $\mathsf P$ to $\mathsf Q$. However, the drift disappears so that $S$ is now a martingale.
See also
[A] https://quant.stackexchange.com/a/40768/51954
[B] Pricing VIX Futures
Literature
[1] Achim Klenke, Wahrscheinlichkeitstheorie. 3. Auflage. Springer-Verlag Berlin/Heidelberg (2013).
[2] N.H. Bingham, Rüdiger Kiesel, Risk-Neutral Valuation. Second Edition. Springer Finance Textbook (2004).
[3] John Hull, Options, Futures, and Other Derivatives, Technical Note No. 22. Available at http://www-2.rotman.utoronto.ca/~hull/technicalnotes/TechnicalNote22.pdf.
Footnotes
[Footnote 1] However, the arguments presented here work for any asset for which options are available.
[Footnote 2] Mathematically, this means that, due to progressive measurability, $\lVert\sigma\rVert_{L^2([0,T])}$, will be $\mathcal F_T-\mathcal B(\mathbb R)$-measurable, but it need not be $\mathcal F_t-\mathcal B(\mathbb R)$-measurable for any $t<T$.
[Footnote 3] For changing the numéraire, see the discussion in [2; section 6.1.4].
[Footnote 4] $R$ has unit $\text{time}^{-1}$ and it is given by $e^{TR}=\text{Number of dollars in money market account after time $T$ if $1$ dollar was invested}.$
[Footnote 5] This formula says nothing more than that the discounted price of the contingent claim is a martingale with respect to $\hat P$.
[Footnote 6] TODO: Make the filtration more clear. Do we have to work with the natural filtration of the Brownian motion?