BUG: Implement forecasting for ARCH-in-mean models - #859
Open
gaoflow wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
force-pushed
the
fix-archinmean-forecast
branch
from
July 31, 2026 12:57
21411d7 to
baa2bd3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ARCHInMean.forecasthas raisedNotImplementedErrorsince the model was added in 2021, even though the class docstring example ends atfit()and the rest of the class (simulate,resids) works. This implements it by mirroringARX.forecastand adding thekappa * 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
formsettings. Multi-horizon analytic forecasts use the variance forecast recursion, which is exact whenform='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 forvar, thekappa=0case reducing byte-for-byte to an ARX forecast, exog composition, bootstrap, and the EGARCH h>1 constraint. Full suite: 4948 passed.