Class HarRv
java.lang.Object
com.quantfinlib.volatility.HarRv
HAR-RV (Corsi's Heterogeneous AutoRegressive realized-volatility
model) — the forecasting benchmark GARCH papers have to beat, and it
is three regressors and an intercept:
RV_{t+1} = c + β_d·RV_t + β_w·RV̄_t^{(5)} + β_m·RV̄_t^{(22)} + ε
daily, weekly-average and monthly-average realized variance — the
"heterogeneous" traders operating at three horizons. Fits by plain
OLS on the normal equations (no optimizer), forecasts one step
ahead, and floors the forecast at zero (a negative variance forecast
is an extrapolation artifact, not a market view).
Feed it realized DAILY variance — squared returns summed
intraday, or JumpRobustVolatility's bipower variance when
jumps should not contaminate the forecast (the standard pairing).
Static, deterministic, research lane.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordFitted coefficients:rv⁺ = c + βd·d + βw·w + βm·m. -
Method Summary
Modifier and TypeMethodDescriptionstatic HarRv.Paramsfit(double[] realizedVariance) Fits by OLS.static doubleforecast(double[] realizedVariance, HarRv.Params p) One-step-ahead RV forecast from the series' most recent day/week/ month, floored at zero.
-
Method Details
-
fit
Fits by OLS. Needs enough history for the monthly window plus a meaningful regression sample.- Parameters:
realizedVariance- daily RV series, ≥ 60 finite non-negative observations
-
forecast
One-step-ahead RV forecast from the series' most recent day/week/ month, floored at zero.
-