Calibrating a HAR (Heterogeneous Autoregressive) model is straightforward and much simpler than calibrating most GARCH-type models. Here’s a step-by-step guide, including both the intuition and the practical steps:
1. Specify the Model
The standard HAR-RV model for realized volatility (RV) is:
[
\text{RV}_{t+1} = \beta_0 + \beta_d \cdot \text{RV}_t^{(d)} + \beta_w \cdot \text{RV}_t^{(w)} + \beta_m \cdot \text{RV}t^{(m)} + \epsilon {t+1}
]
Where:
(\text{RV}_t^{(d)}) = Realized volatility on day (t)
(\text{RV}_t^{(w)}) = Average realized volatility over the past week (e.g., 5 trading days)
(\text{RV}_t^{(m)}) = Average realized volatility over the past month (e.g., 22 trading days)
2. Prepare the Data
Compute daily realized volatility (e.g., sum of squared intraday returns for each day).
Create lagged features :
(\text{RV}_t^{(d)} = \text{RV}_t)
(\text{RV}t^{(w)} = \frac{1}{5} \sum {i=0}^{4} \text{RV}_{t-i})
(\text{RV}t^{(m)} = \frac{1}{22} \sum {i=0}^{21} \text{RV}_{t-i})
3. Estimate the Parameters (Calibrate)
The HAR model is a linear regression.
Method: Ordinary Least Squares (OLS)
Inputs: The lagged RV features as regressors, and the next day’s RV as the dependent variable.
In Python (pseudocode):
python Copy code
import pandas as pd
import statsmodels.api as sm
# Assume df has columns: 'RV'
df['RV_d'] = df['RV'].shift(0)
df['RV_w'] = df['RV'].rolling(5).mean().shift(0)
df['RV_m'] = df['RV'].rolling(22).mean().shift(0)
df['RV_next'] = df['RV'].shift(-1)
df = df.dropna()
X = df[['RV_d', 'RV_w', 'RV_m']]
X = sm.add_constant(X)
y = df['RV_next']
model = sm.OLS(y, X).fit()
print(model.summary())
The estimated coefficients ((\beta_0, \beta_d, \beta_w, \beta_m)) are your calibrated parameters .
4. Out-of-Sample Validation (Recommended)
Split your data into training and test sets (e.g., 80/20 split).
Fit the model on the training set.
Forecast on the test set and compare predictions to actual realized volatility.
Metrics: Use MSE, QLIKE, or other loss functions.
5. (Optional) Rolling or Expanding Window Calibration
For more realistic trading/backtesting, re-estimate the model parameters periodically (e.g., every month) using only past data up to that point.
This mimics how you’d use the model in real time.
6. (Optional) Extensions
Add more lags (e.g., bi-weekly, quarterly).
Add realized quarticity (HARQ model).
Log-transform RV if the distribution is highly skewed.
Summary Table
Step What You Do How You Do It Specify Model Write down HAR equation See above Prepare Data Compute daily, weekly, monthly RV Rolling means Estimate Parameters Fit linear regression (OLS) statsmodels.OLS or similarValidate Out-of-sample forecast & metrics Train/test split (Optional) Update Rolling/expanding window Loop over time
Key Points
HAR is just a linear regression with lagged averages as features.
Calibration = OLS regression on historical data.
No need for MLE, optimization, or complex likelihoods (unlike GARCH).
That’s it!
You now have a calibrated HAR model, ready for forecasting daily realized volatility.