The Volatility Risk Premium in Python: What VIX Actually Measures

The Volatility Risk Premium in Python: What VIX Actually Measures
On 2026-11-20 the VIX closed at 35.89 while the S&P 500’s trailing 21-session realized volatility stood at 26.42 — implied fear running well above realized fear, and both running far above the 15.08 average of every trailing window since 2016. That gap has a name: the volatility risk premium, the difference between the risk-neutral variance priced into options and the variance that actually materializes in returns. The definition is simple; the measurement is not, because the VIX forecasts 30 calendar days while a close-to-close realized variance covers 21 trading sessions, and because the two sides are priced off different instruments. This post is a reproducible Python pipeline built on two free FRED series, with the numbers it produces, the places it breaks, and the claims it cannot support.
Provenance: data, computation date, sample, and what we did not do. Every figure here was computed on 2026-11-23 from three daily FRED series: VIXCLS (Cboe VIX close), SP500 (S&P 500 close), and VXVCLS (3-month volatility index, used only for the term-structure snapshot). The paired sample is 2,489 trading days, 2016-11-25 through 2026-10-21 — the last date with a complete forward 21-session window. Realized variance is annualized from daily log returns of the S&P 500 close; implied variance is (VIX/100)²; the premium is their difference, reported in both vol points and annualized variance points.
What we did not do: no intraday returns, so realized variance is a close-to-close approximation; no variance swap rates, so VIX squared is an implied-variance proxy; no exact 30-calendar-day interpolation, so the forward window is 21 trading sessions; no predictability regressions; no trading, backtest, or P&L results of any kind.
The VIX: What It Measures, and What It Doesn’t
The VIX is a 30-calendar-day, model-free estimate of expected S&P 500 volatility, built entirely from SPX and SPXW option mid-quotes with no index price data entering the calculation. It is an option-implied forecast rather than a record of anything that has happened. That distinction is the whole reason a volatility risk premium can exist: the premium compares a forecast with a future outcome.
The Cboe VIX methodology (v6.0) fixes every convention. Only options with a non-zero bid are eligible; prices are mid-quotes; the index is built with the variance-replication formula of Demeterfi, Derman, Kamal & Zou (1999); and the near-term and next-term brackets are combined by constant-maturity interpolation. The published index is sigma × 100, so any calculation in variance space has to square (VIX/100) rather than use VIX directly.
Two mechanical details matter for anyone reading a long VIX chart. First, the index contains no S&P 500 price data — it is assembled purely from option quotes, which is exactly why it can diverge from realized volatility. Second, the series has a seam. Values back to January 1990 are a back-cast, the original 1993 index used S&P 100 (OEX) options, and the current SPX-based construction launched on 2003-09-22, as documented on the Cboe historical data page. Anything before 2003 is a reconstruction, not a live print.
The Data, and Its Hard Limits
Everything in this post comes from three daily FRED series: VIXCLS for the implied side, SP500 for the realized side, and VXVCLS for the term structure. The binding constraint is the price side — FRED’s S&P 500 close runs back only about ten years — so the paired sample begins in November 2016 and covers a decade with a pandemic and a violent rate repricing inside it.
The CSV endpoints are stable and machine-readable: https://fred.stlouisfed.org/graph/fredgraph.csv?id=VIXCLS, the same pattern for SP500 and VXVCLS. If you would rather take the implied side from the source than a redistributor, Cboe publishes its own daily file at https://cdn-api.cboe.com/api/global/us_indices/daily_prices/VIX_History.csv.
Two cleaning details are easy to get wrong. Holidays and other non-trading days appear as . in the FRED CSVs and must be dropped, not zero-filled: inserting fake zero returns would dilute the realized-variance sum and bias realized volatility downward. And the two series must be aligned on common trading dates before any pairing, because a VIX print with no matching close (or the reverse) is not an observation.
Ten years is enough to describe a regime. It is not enough to describe a cycle, and no result here should be read as a statement about 1998, 2008, or the early 2000s.
The Measurement Pipeline in Python
The computation is a handful of lines: log returns, a 21-session forward sum of squared returns annualized to a year, implied variance as (VIX/100)², and the difference between the two. Two conventions decide whether the output is sensible at all — the forward shift and the annualization factor — and both can be broken in ways that still produce plausible-looking numbers.
Load and align first:
import numpy as np
import pandas as pd
def fred(series_id: str) -> pd.Series:
"""Daily FRED CSV -> clean float Series indexed by date."""
raw = pd.read_csv(f"https://fred.stlouisfed.org/graph/fredgraph.csv?id={series_id}")
raw.columns = ["date", "value"] # fredgraph.csv ships observation_date,<ID>
raw["date"] = pd.to_datetime(raw["date"])
s = pd.to_numeric(raw["value"], errors="coerce") # "." on holidays -> NaN -> dropped
return s.dropna().rename(series_id)
px = fred("SP500") # S&P 500 daily close (realized side)
vix = fred("VIXCLS") # Cboe VIX daily close (implied side)
vxv = fred("VXVCLS") # 3-month volatility index (term structure only)
px, vix = px.align(vix, join="inner") # pair only on common trading dates
Then the core measurement, with the conventions spelled out:
r = np.log(px).diff() # daily log returns of the S&P 500 close
rv_var = r.pow(2).rolling(21).sum().mul(252/21).shift(-21)
# 21 trading sessions of squared returns ...
# .mul(252/21) annualizes a 21-session sum. Drop the /21 and realized
# volatility is inflated by sqrt(21) ~ 4.58x, which wrecks every spread.
# .shift(-21) makes the window FORWARD: the sum at row t covers t+1..t+21.
# A shift(+21) would score the VIX against volatility that already
# happened, flipping the sign of the premium.
iv_var = (vix/100)**2 # implied-variance PROXY, not a variance swap rate
vrp_var = iv_var - rv_var # annualized variance points
rv_vol = 100*np.sqrt(rv_var) # the same realized variance, in vol points
vrp_vol = vix - rv_vol # the same premium, in vol points
m = pd.DataFrame({"px": px, "vix": vix, "rv_vol": rv_vol,
"vrp_vol": vrp_vol, "vrp_var": vrp_var}).dropna()
m.index.name = "date"
Summaries, and the tables used later in this post:
s = m["vrp_vol"]
print({
"mean": round(s.mean(), 2),
"median": round(s.median(), 2),
"std": round(s.std(), 2),
"share_positive": round((s > 0).mean(), 4),
"p05": round(s.quantile(0.05), 2),
"p95": round(s.quantile(0.95), 2),
})
m["year"] = m.index.year
yearly = m.groupby("year")["vrp_vol"].agg(
mean_vrp="mean",
share_positive=lambda x: (x > 0).mean(),
)
m["vix_quintile"] = pd.qcut(m["vix"], 5, labels=False)
quintile = m.groupby("vix_quintile").agg(
mean_vix=("vix", "mean"),
mean_vrp=("vrp_vol", "mean"),
)
roll252 = m["vrp_vol"].rolling(252).mean().iloc[::5] # 448 windows, 5-session stride
print(roll252.min(), roll252.max(), (roll252 < 0).mean())
Two properties of this construction deserve naming. First, iv_var is an implied-variance proxy: it is not the variance swap rate that an option portfolio approximates, and it should never be labelled as one. Second, adjacent rows overlap — the window ending at t+21 and the window ending at t+22 share 20 of their 21 sessions. The sample is a sequence of heavily overlapping windows, not 2,489 independent observations.
Where Our Number Diverges from the Literature
The literature measures this premium with instruments a daily-close pipeline does not have, and the differences are methodological rather than contradictory. Bollerslev, Tauchen & Zhou (2009) build realized variance from intraday data and test predictability over 1990-2007; Carr & Wu (2009) approach it from the pricing side, through an option portfolio and a variance swap rate. Our series is a close-to-close stand-in over 2016-2026, not a replication of either.
On their 1990-2007 sample, Bollerslev, Tauchen & Zhou find the premium most predictable at the quarterly horizon, with a t-statistic of 2.86 and an adjusted R² of 6.82%, while the monthly adjusted R² sits just above 1%. Those are their results on their sample. We ran no predictability regressions, and nothing in our numbers should be read as confirming or contradicting them. Their realized variance is built from intraday returns, which removes the noise and the bid-ask bounce that dominates a close-to-close daily variance estimate.
Carr and Wu show that risk-neutral expected variance is well approximated by a portfolio of options, and that realized variance minus that synthetic variance-swap rate quantifies the premium — a sign convention that runs opposite to the implied-minus-realized spread used here. The distinction matters for a second reason: our implied side is a proxy for expected variance, not the variance swap rate itself, so the magnitude of our spread is not directly comparable to the premium Carr and Wu measure.
Four choices separate the two bodies of work. Daily close-to-close realized variance versus intraday realized variance. Twenty-one trading sessions versus the VIX’s exact 30 calendar days. Forward windows versus trailing windows. And a 2016-2026 sample versus their 1990-2007 span. Only the second difference is a pure measurement artifact; the others are definition and regime.
What the Ten-Year Sample Shows
Across 2,489 paired trading days the implied-minus-realized spread averaged +3.60 vol points, was positive on 83.81% of days, and widened with the level of the VIX: the highest VIX quintile averaged +5.59 against +2.47 in the lowest. The premium is neither constant nor permanent. All figures below are computed from FRED VIXCLS + SP500 daily closes on 2026-11-23.
| Statistic (vol points) | Value |
|---|---|
| Mean | +3.60 |
| Median | +4.66 |
| Standard deviation | 8.29 |
| Share of days positive | 83.81% |
| 5th percentile | -6.84 |
| 95th percentile | +12.30 |
Source: computed from FRED VIXCLS + SP500 daily closes, 2026-11-23.
| Year | Mean VRP (vol points) | Share of days positive |
|---|---|---|
| 2018 | +0.71 | 61% |
| 2021 | +6.87 | 95% |
| 2022 | +1.89 | 65% |
| 2023 | +4.32 | 100% |
| 2026 (through October) | +4.86 | 91% |
Source: computed from FRED VIXCLS + SP500 daily closes, 2026-11-23. Only the years listed here were broken out; the remaining years in the sample were not tabulated.
| VIX quintile | Mean VIX in quintile | Mean VRP (vol points) |
|---|---|---|
| Lowest | 11.65 | +2.47 |
| Second | 14.58 | +2.17 |
| Third | 17.03 | +3.83 |
| Fourth | 20.42 | +3.92 |
| Highest | 29.62 | +5.59 |
Source: computed from FRED VIXCLS + SP500 daily closes, 2026-11-23.
In annualized variance units — a separate measurement from the vol-point spread above — the same premium has a mean of +0.0069, a median of +0.0118, and a standard deviation of 0.0716. These numbers live in a different unit than the tables above and should not be added to them or compared with them directly.
Two readings stand out. The premium is wider when the market is already nervous: the top quintile’s mean VIX of 29.62 carries a +5.59 spread, while the two calmest quintiles carry roughly +2.2 each. And the year-to-year path is uneven — 2018’s +0.71 with 61% positive days sits next to 2023’s +4.32 with every day positive, and 2022’s +1.89 with 65% positive days sits between them. A rolling 252-session mean of the spread ranged from -2.67 to +9.50 and was negative in 4.7% of 448 overlapping windows, which says the negative regime occupies real stretches rather than isolated days.
When the Premium Fails, and What the Term Structure Adds
The premium is a spread, and spreads cross zero. On 2026-10-21 the VIX closed at 16.68, and the next 21 sessions delivered realized volatility of 23.35 — a premium of -6.67 vol points, with the implied side under-shot reality. That observation is also the last row of the paired sample, since its forward window closes on the most recent complete date.
The 2026-11-20 snapshot adds a second layer. The S&P 500 closed at 6910.39, the VIX at 35.89, and the three-month VIX index at 30.94 — a +4.95 gap between the near-term and 3-month implied, meaning the term structure was inverted. Trailing 21-session realized volatility of 26.42 sat at the 92nd percentile of the 2016-2026 trailing distribution, whose average is 15.08. (This snapshot falls outside the paired sample because its forward window is not yet complete, so it is a state reading, not an observation of the premium.)
An inverted structure says that near-term implied volatility exceeds 3-month implied volatility, which the market typically reads as event risk priced into the front of the curve. It says nothing about whether realized volatility will come in below the VIX. It is a statement about the shape of implied expectations, not about the realized path — and a reader who treats it as a forecast of realized volatility has swapped one mistake for another.
One related figure deserves careful labelling: on 86.39% of days in the sample the VIX sat above the trailing 21-session realized volatility. That statistic uses a trailing window while the premium above uses a forward window, so the two are not the same object and should not be quoted interchangeably. (Figures in this section are computed from FRED VIXCLS + SP500 + VXVCLS on 2026-11-23.)
Using the Series Without Fooling Yourself
Three traps sit inside the code rather than in the interpretation. Adjacent rows share 20 of 21 sessions, so naive standard errors on daily spreads overstate precision; a rolling-window label leaks across a naive train/test split; and a measurement exercise cannot promote itself into a claim about predictability or tradability. Treat the series as a description, not a verdict.
Effective sample size. Because neighbouring windows overlap in 20 of 21 sessions, the information content of 2,489 rows is closer to that of a much smaller set of independent episodes. As a rough guide, treat the effective n as on the order of n/21. Any t-statistic or p-value computed on the daily spread with a textbook standard error would be misleading, which is why none are reported here for these numbers.
Cross-validation hygiene. For machine-learning readers: if you train a regressor of forward realized variance on lagged implied variance, or a classifier of premium-positive windows, every split must be purged and embargoed by at least the 21-session horizon. A label built from a forward window overlaps the training period on the other side of the split, so without that embargo the model is evaluated on rows whose labels were generated partly from its training data. The same rule applies to any feature built from rolling realized volatility.
Scope. A measurement post can describe a spread, its distribution, its dependence on the VIX level, and the windows in which it failed. It cannot conclude that the spread is predictable, that it compensates for a risk factor, or that it is tradeable. Any claim of tradability requires a separate study with a stated position rule, a stated transaction-cost model, and a stated evaluation window. None of that is in scope here, and no part of this post should be read as a strategy or a return.
FAQ
Is the VIX a forecast of realized volatility?
Yes, in the sense that it estimates what the market expects S&P 500 volatility to be over the next 30 calendar days — but it is a forecast built entirely from option prices, containing no information about the index level itself. It will disagree with realized volatility on any given day, and that disagreement is the object of study rather than an error to be cleaned up. Note also the horizon: the VIX looks 30 calendar days ahead, while the forward window used here covers 21 trading sessions, so part of any spread we compute is horizon mismatch rather than pricing compensation.
Why compute realized variance from daily closes instead of intraday data?
Three reasons. Intraday data is harder to obtain cleanly and consistently across a decade, and many public sources carry gaps and licensing limits, while FRED’s daily closes are free, stable, and machine-readable. Second, daily-close realized variance is what most research and retail pipelines actually have, so a number built from it is reproducible by anyone reading this post. Third — and this is the honest caveat — close-to-close variance is a coarser estimate of the same quantity than an intraday estimator, since each daily return folds overnight jumps and the whole intraday path into a single observation. That is why Bollerslev, Tauchen & Zhou use intraday returns, and why our premium should not be expected to match theirs level for level.
Why does the sample start in November 2016?
FRED’s S&P 500 daily close series runs back only about ten years, and each observation needs a complete 21-session forward window after it. The first usable paired date is therefore 2016-11-25, and the last is 2026-10-21, the most recent date with a full forward window. Ten years covers a regime containing a pandemic, a sharp rate repricing, and a volatility spike, but no pre-2008 crisis. Any comparison with the classic 1990-2007 literature is therefore a comparison of different periods, not a like-for-like replication.
Key Takeaways
Five points summarize the exercise. The premium is a spread between an implied forecast and a realized outcome; its measured size depends on how closely horizons are aligned; it widens with the VIX level and crosses zero regularly; overlapping windows make naive statistics misleading; and nothing measured here is a return or a position.
- The premium is a forecast-versus-outcome spread: implied variance minus realized variance, averaging +3.60 vol points and positive on 83.81% of days across 2,489 paired trading days (computed from FRED VIXCLS + SP500 on 2026-11-23).
- Horizon mismatch is structural, not a footnote: the VIX forecasts 30 calendar days, a close-to-close pipeline measures 21 trading sessions.
- The premium is not constant — +5.59 vol points in the highest VIX quintile versus +2.47 in the lowest — and it fails: -6.67 vol points on 2026-10-21, with negative rolling means in 4.7% of 448 windows.
- Neighbouring rows share 20 of 21 sessions, so treat effective n as roughly n/21 and purge/embargo any machine-learning split by at least the 21-session horizon.
- This is a measurement exercise. Predictability and tradability are separate studies with their own rules, and no such claim is made here.


