Volatility Risk Premium

Medium · Volatility Risk Premium

A Python research project comparing implied and forward realized volatility, with notebooks and a Streamlit dashboard.

  • Python
  • Pandas
  • NumPy
  • Streamlit
Original VRP Streamlit dashboard

VIX vs. realized volatility

Historical volatility

Annualized volatility (%)Monthly observation date
  • VIX
  • Forward realized volatility
4.4544.885.12010-01-292026-04-22
196 monthly observations, 2010-01-29 to 2026-04-22. At the last observation, VIX was 18.92% and forward realized volatility was 9.58%.
View chart data
Annualized volatility (%) by monthly observation date
Monthly observation dateVIXForward realized volatility
2010-01-2924.6215
2010-02-2619.57.39
2010-03-3117.5923.06
2010-04-3022.0531.3
2010-05-2832.0724.68
2010-06-3034.5420.22
2010-07-3023.519
2010-08-3126.0514.64
2010-09-3023.711.45
2010-10-2921.214.3
2010-11-3023.548.51
2010-12-3117.7510
2011-01-3119.5314.43
2011-02-2818.3514.47
2011-03-3117.749.74
2011-04-2914.7512.48
2011-05-3115.4516.21
2011-06-3016.5236.74
2011-07-2925.2543.48
2011-08-3131.6229.85
2011-09-3042.9630.05
2011-10-3129.9627.64
2011-11-3027.816.35
2011-12-3023.48.69
2012-01-3119.4410.55
2012-02-2918.4313.14
2012-03-3015.513.54
2012-04-3017.1515.99
2012-05-3124.0618.44
2012-06-2917.0813.08
2012-07-3118.939.98
2012-08-3117.4710.67
2012-09-2815.7312.77
2012-10-3118.613.31
2012-11-3015.8712.24
2012-12-3118.029.93
2013-01-3114.2810.97
2013-02-2815.518.44
2013-03-2812.713.19
2013-04-3013.5212.08
2013-05-3116.315.14
2013-06-2816.867.51
2013-07-3113.4510.27
2013-08-3017.0111.39
2013-09-3016.612.29
2013-10-3113.759.13
2013-11-2913.79.92
2013-12-3113.7214.41
2014-01-3118.4112.34
2014-02-281412.68
2014-03-3113.8811.72
2014-04-3013.417.62
2014-05-3011.46.33
2014-06-3011.5710.54
2014-07-3116.957.51
2014-08-2912.0914.01
2014-09-3016.3116.07
2014-10-3114.038.85
2014-11-2813.3316.09
2014-12-3119.216.04
2015-01-3020.9712.21
2015-02-2713.3412.76
2015-03-3115.299.71
2015-04-3014.5510.25
2015-05-2913.8412.22
2015-06-3018.2311.42
2015-07-3112.1226.44
2015-08-3128.4320.44
2015-09-3024.512.04
2015-10-3015.0714.77
2015-11-3016.1319.44
2015-12-3118.2122.58
2016-01-2920.217.6
2016-02-2920.5511.91
2016-03-3113.9510.41
2016-04-2915.710.21
2016-05-3114.1916.81
2016-06-3015.637.09
2016-07-2911.879.94
2016-08-3113.4212.95
2016-09-3013.299.78
2016-10-3117.069.78
2016-11-3013.337.4
2016-12-3014.046.03
2017-01-3111.996.52
2017-02-2812.927.18
2017-03-3112.376.14
2017-04-2810.827.1
2017-05-3110.417.43
2017-06-3011.187.14
2017-07-3110.269.11
2017-08-3110.595.03
2017-09-299.514.45
2017-10-3110.185.8
2017-11-3011.286.29
2017-12-2911.0421.23
2018-01-3113.5423.18
2018-02-2819.8520.77
2018-03-2919.9715.49
2018-04-3015.939.58
2018-05-3115.439.23
2018-06-2916.098.03
2018-07-3112.836.56
2018-08-3112.8613.29
2018-09-2812.1221.5
2018-10-3121.2320.71
2018-11-3018.0727.61
2018-12-3125.4216.21
2019-01-3116.579.04
2019-02-2814.7810.54
2019-03-2913.7111.2
2019-04-3013.1214.83
2019-05-3118.719.21
2019-06-2815.0814.26
2019-07-3116.1220.36
2019-08-3018.9812.67
2019-09-3016.2411.78
2019-10-3113.227.11
2019-11-2912.627.81
2019-12-3113.7811.8
2020-01-3118.8467.98
2020-02-2840.1185.14
2020-03-3153.5437.1
2020-04-3034.1528.02
2020-05-2927.5126.49
2020-06-3030.4312.38
2020-07-3124.4618.64
2020-08-3126.4123.49
2020-09-3026.3721.02
2020-10-3038.0214.34
2020-11-3020.5710.16
2020-12-3122.7515.28
2021-01-2933.0916.46
2021-02-2627.9515.21
2021-03-3119.413.14
2021-04-3018.6111.85
2021-05-2816.768.74
2021-06-3015.8310.33
2021-07-3018.247.82
2021-08-3116.4812.94
2021-09-3023.149.87
2021-10-2916.2614.86
2021-11-3027.1916.13
2021-12-3117.2219.45
2022-01-3124.8323.86
2022-02-2830.1521.62
2022-03-3120.5627.52
2022-04-2933.431.5
2022-05-3126.1925.78
2022-06-3028.7117.91
2022-07-2921.3319.19
2022-08-3125.8726.51
2022-09-3031.6230.29
2022-10-3125.8824.73
2022-11-3020.5817.85
2022-12-3021.6716.28
2023-01-3119.416.5
2023-02-2820.715.98
2023-03-3118.711.97
2023-04-2815.7812.38
2023-05-3117.9410.09
2023-06-3013.599.09
2023-07-3113.6311.31
2023-08-3113.5711.51
2023-09-2917.5214.8
2023-10-3118.1410.45
2023-11-3012.929.75
2023-12-2912.4511.44
2024-01-3114.3511.8
2024-02-2913.411.32
2024-03-2813.0113.02
2024-04-3015.658.7
2024-05-3112.926.89
2024-06-2812.4418.43
2024-07-3116.3619.29
2024-08-301512.96
2024-09-3016.7312.79
2024-10-3123.1610.74
2024-11-2913.5114.9
2024-12-3117.3512.72
2025-01-3116.4317.66
2025-02-2819.6341.26
2025-03-3122.2842.04
2025-04-3024.714.28
2025-05-3018.579.26
2025-06-3016.739.63
2025-07-3116.7210.78
2025-08-2915.3611.44
2025-09-3016.2813.71
2025-10-3117.4412.95
2025-11-2816.358.25
2025-12-3114.9512.43
2026-01-3017.4413.43
2026-02-2719.8617.87
2026-03-3125.2511
2026-04-2218.929.58

Monthly observations from the project dataset · January 2010–April 2026.

From the notebook

Full notebook ↗

02_realized_volatility.ipynb · original code cells

Cell 3Realized volatility
import numpy as np

#  ln(P_t / P_{t-1})
merged_df['spx_log_ret'] = np.log(merged_df['spx_close'] / merged_df['spx_close'].shift(1))

# rollingStandardDeviation
merged_df['spx_roll_std'] = merged_df['spx_log_ret'].rolling(window=30).std()

# annualizeDailyVolatility
merged_df['spx_realized_vol'] = merged_df['spx_roll_std'] * np.sqrt(252)

# tail
merged_df[['spx_close', 'spx_log_ret', 'spx_roll_std', 'spx_realized_vol']].tail()
Cell 11Forward alignment
# 1. Shift the realized volatility backwards by 30 trading days
# shiftThirty
merged_df['forward_realized_vol'] = merged_df['spx_realized_vol'].shift(-30)

# 2. dropFinalThirty
master_df = merged_df.dropna(subset=['forward_realized_vol']).copy()


master_dataset = master_df[['spx_close', 'vix_decimal', 'forward_realized_vol']]
master_dataset.to_csv('../src/data/master_dataset.csv')

print("Aligned master dataset exported successfully!")
print(f"Original rows: {len(merged_df)}")
print(f"New rows (should be exactly 30 fewer): {len(master_dataset)}")