Skip to content

BUG: Implement forecasting for ARCH-in-mean models - #859

Open
gaoflow wants to merge 1 commit into
bashtage:mainfrom
gaoflow:fix-archinmean-forecast
Open

BUG: Implement forecasting for ARCH-in-mean models#859
gaoflow wants to merge 1 commit into
bashtage:mainfrom
gaoflow:fix-archinmean-forecast

Conversation

@gaoflow

@gaoflow gaoflow commented Jul 31, 2026

Copy link
Copy Markdown

ARCHInMean.forecast has raised NotImplementedError since the model was added in 2021, even though the class docstring example ends at fit() and the rest of the class (simulate, resids) works. This implements it by mirroring ARX.forecast and adding the kappa * f(sigma2) term to the mean recursion and the simulation/bootstrap paths.

Repro: ARCHInMean(y, lags=[1, 2], volatility=GARCH()).fit().forecast(horizon=3).

The 1-step analytic forecast is exact for all form settings. Multi-horizon analytic forecasts use the variance forecast recursion, which is exact when form='var' and the standard plug-in approximation otherwise. EGARCH and APARCH keep their existing analytic multi-horizon constraint (ValueError).

Tests cover a hand-computed closed-form recursion for var/vol/log, convergence of the simulation forecast to the analytic forecast for var, the kappa=0 case reducing byte-for-byte to an ARX forecast, exog composition, bootstrap, and the EGARCH h>1 constraint. Full suite: 4948 passed.

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.54%. Comparing base (9b89bf4) to head (baa2bd3).

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #859    +/-   ##
========================================
  Coverage   99.54%   99.54%            
========================================
  Files          78       78            
  Lines       15818    15999   +181     
  Branches     1294     1307    +13     
========================================
+ Hits        15746    15927   +181     
  Misses         38       38            
  Partials       34       34            
Flag Coverage Δ
adder 99.51% <100.00%> (+<0.01%) ⬆️
subtractor 99.51% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ARCHInMean.forecast has raised NotImplementedError since the model was
added in 2021. Implement it by mirroring ARX.forecast and adding the
kappa*f(sigma2) term to the mean recursion and to the simulation and
bootstrap paths. The one-step analytic forecast is exact for all form
specifications; multi-horizon analytic forecasts use the variance
forecast recursion, which is exact when form is 'var'.
@gaoflow
gaoflow force-pushed the fix-archinmean-forecast branch from 21411d7 to baa2bd3 Compare July 31, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant