Rolling window forecast with rolling demean

Open
#633 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@gavincyi is already working on this.

Since Mar 15, 2023.

  • #634 by @gavincyi — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start with the linked Rolling-Window Forecasting documentation and the arch_model / fit usage shown in the issue. Trace how first_obs and last_obs affect fitting, then determine whether the constant mean is estimated over the rolling window or the full series. Done means explaining that behavior and whether the described rolling demeaning approach is supported; the issue names no source files or tests.

Written by the indexing model from the issue text.

Description

I saw in the documentation that rolling window forecast can be applied with parameter first_obs and last_obs, while I am looking for an approach with minimal runtime overhead to

  1. demean the series in rolling basis, i.e. returns[first_obs:last_obs] - mean(returns[first_obs:last_obs]), and
  2. fit the GARCH model

I wonder if the constant mean is applied on the rolling basis, or actually on the whole timeseries of argument y.

model = arch_model(tseries, vol="GARCH", mean="Constant", ...)
for i in range(len(tseries) - rolling_window):
  model.fit(first_obs=i, last_ob=i + rolling_window - 1, ...)

I tried to look into the source code but could not conclude it in a glance. Could you help address it?

Dominant language
Python
Stars
1.6k
Forks
298
Avg merge
14h 46m
Merged PRs (30d)
106

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bashtage/arch

All issues in bashtage/arch

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.