Skip to content

Add tests for AR mean forecast simulation paths#849

Open
aeshef wants to merge 1 commit into
bashtage:mainfrom
aeshef:test/ar-mean-forecast-simulation-paths
Open

Add tests for AR mean forecast simulation paths#849
aeshef wants to merge 1 commit into
bashtage:mainfrom
aeshef:test/ar-mean-forecast-simulation-paths

Conversation

@aeshef

@aeshef aeshef commented Jun 17, 2026

Copy link
Copy Markdown

While reading through the forecasting code, I noticed the comment with the AR mean simulation path construction was "not tested, but probably right". The added tests verify this branch directly for AR(1) and AR(2) models with GARCH volatility, covering both method="simulation" and method="bootstrap".

The tests recompute the simulated mean paths and long-run variance paths from the simulated residuals and residual variance paths, and compare these against the values returned by forecast.simulations.

Tested locally with:

pytest arch/tests/univariate/test_forecast.py::TestForecasting::test_ar1_garch_mean_forecast_simulation_paths arch/tests/univariate/test_forecast.py::TestForecasting::test_ar2_garch_mean_forecast_simulation_paths -v

Verify simulated mean and variance paths for AR forecasts using
simulation and bootstrap methods.
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.05882% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.53%. Comparing base (8cdc7de) to head (db9a441).

Files with missing lines Patch % Lines
arch/tests/univariate/test_forecast.py 97.05% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #849      +/-   ##
==========================================
- Coverage   99.54%   99.53%   -0.02%     
==========================================
  Files          78       78              
  Lines       15818    15886      +68     
  Branches     1294     1300       +6     
==========================================
+ Hits        15746    15812      +66     
- Misses         38       39       +1     
- Partials       34       35       +1     
Flag Coverage Δ
adder 99.49% <97.05%> (-0.02%) ⬇️
subtractor 99.49% <97.05%> (-0.02%) ⬇️

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.

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