Documentation

## Rolling-Window Analysis of Time-Series Models

Rolling-window analysis of a time-series model assesses:

• The stability of the model over time. A common time-series model assumption is that the coefficients are constant with respect to time. Checking for instability amounts to examining whether the coefficients are time-invariant.

• The forecast accuracy of the model.

### Rolling-Window Analysis for Parameter Stability

Suppose that you have data for all periods in the sample. To check the stability of a time-series model using a rolling window:

1. Choose a rolling window size, m, i.e., the number of consecutive observation per rolling window. The size of the rolling window will depend on the sample size, T, and periodicity of the data. In general, you can use a short rolling window size for data collected in short intervals, and a larger size for data collected in longer intervals. Longer rolling window sizes tend to yield smoother rolling window estimates than shorter sizes.

2. Suppose that the number of increments between successive rolling windows is 1 period, then partition the entire data set into N = Tm + 1 subsamples. The first rolling window contains observations for period 1 through m, the second rolling window contains observations for period 2 through m + 1, and so on.

There are variations on the partitions, e.g., rather than roll one observation ahead, you can roll four observations for quarterly data.

3. Estimate the model using each rolling window subsamples.

4. Plot each estimate and point-wise confidence intervals (i.e., $\stackrel{^}{\theta }±2\left[\stackrel{^}{SE}\left(\stackrel{^}{\theta }\right)\right]$) over the rolling window index to see how the estimate changes with time. You should expect a little fluctuation for each, but large fluctuations or trends indicate that the parameter might be time varying.

For more details on assessing the stability of a model using rolling window analysis, see .

### Rolling Window Analysis for Predictive Performance

Suppose that you have data for all periods in the sample. You can backtest to check the predictive performance of several time-series models using a rolling window. These steps outline how to backtest.

1. Choose a rolling window size, m, i.e., the number of consecutive observation per rolling window. The size of the rolling window depends on the sample size, T, and periodicity of the data. In general, you can use a short rolling window size for data collected in short intervals, and a larger size for data collected in longer intervals. Longer rolling window sizes tend to yield smoother rolling window estimates than shorter sizes.

2. Choose a forecast horizon, h. The forecast horizon depends on the application and periodicity of the data. The following illustrates how the rolling window partitions the data set.

3. If the number of increments between successive rolling windows is 1 period, then partition the entire data set into N = Tm + 1 subsamples. The first rolling window contains observations for period 1 through m, the second rolling window contains observations for period 2 through m + 1, and so on. The figure illustrates the partitions. There are variations on the partitions, e.g., rather than roll one observation ahead, you can roll four observations for quarterly data.

4. For each rolling window subsample:

1. Estimate each model.

2. Estimate h-step-ahead forecasts.

3. Compute the forecast errors for each forecast, that is ${e}_{nj}={y}_{m-h+n+j}-{\stackrel{^}{y}}_{nj}$, where:

• enj is the forecast error of rolling window n for the j-step-ahead forecast.

• y is the response.

• ${\stackrel{^}{y}}_{nj}$ is the j-step-ahead forecast of rolling window subsample n.

5. Compute the root forecast mean squared errors (RMSEs) using the forecast errors for each step-ahead forecast type. In other words,

6. Compare the RMSEs among the models. The model with the lowest set of RMSEs has the best predictive performance.

For more details on backtesting, see .

 Zivot, E., and J. Wang. Modeling Financial Time Series with S_PLUS®. 2nd ed. NY: Springer Science+Business Media, Inc., 2006.
{"ft_lang_label":"__label__en","ft_lang_prob":0.831045,"math_prob":0.94990367,"size":3769,"snap":"2019-35-2019-39","text_gpt3_token_len":771,"char_repetition_ratio":0.18007968,"word_repetition_ratio":0.45230263,"special_character_ratio":0.20244096,"punctuation_ratio":0.1373093,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98739386,"pos_list":[0,1,2],"im_url_duplicate_count":[null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-09-17T20:01:00Z\",\"WARC-Record-ID\":\"<urn:uuid:ce913765-3774-4d95-bc8a-59c9f8476d8e>\",\"Content-Length\":\"68465\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:fb9e76e7-2ddf-4834-8413-d765f2df753e>\",\"WARC-Concurrent-To\":\"<urn:uuid:3ec0d616-1bc0-4eda-985a-84d8c2e25e91>\",\"WARC-IP-Address\":\"23.48.45.75\",\"WARC-Target-URI\":\"https://au.mathworks.com/help/econ/rolling-window-estimation-of-state-space-models.html\",\"WARC-Payload-Digest\":\"sha1:IXSXVTBMPP7W4QIPLSHHAYA6DSWTWIQH\",\"WARC-Block-Digest\":\"sha1:2IWXWUUB53CLFVUW2WLDZEJ34JCELEOX\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-39/CC-MAIN-2019-39_segments_1568514573105.1_warc_CC-MAIN-20190917181046-20190917203046-00019.warc.gz\"}"}