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

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.54%. Comparing base (543f44c) to head (3da6c09).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #849   +/-   ##
=======================================
  Coverage   99.54%   99.54%           
=======================================
  Files          78       78           
  Lines       15818    15912   +94     
  Branches     1294     1301    +7     
=======================================
+ Hits        15746    15840   +94     
  Misses         38       38           
  Partials       34       34           
Flag Coverage Δ
adder 99.50% <100.00%> (+<0.01%) ⬆️
subtractor 99.50% <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.

@aeshef aeshef force-pushed the test/ar-mean-forecast-simulation-paths branch from db9a441 to 4b3cf43 Compare June 23, 2026 12:12
Verify simulated mean and variance paths for AR forecasts using
simulation and bootstrap methods.
@aeshef aeshef force-pushed the test/ar-mean-forecast-simulation-paths branch from 4b3cf43 to 3da6c09 Compare June 23, 2026 12:33
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