GAUSS rolling Example

Rolling regression plot.

Introduction

This example demonstrates the use of the GAUSS rolling procedure for estimating rolling and recursive window regressions. It uses the GAUSS dataset "rolling.dat".

This dataset stores 400 observations of generated data with a break in the intercept after 120 observations along with the random independent data used in data generation. The error terms are standard normal.

Load Data

This example loads the data using the GAUSS function loadd. The function loadd utilizes the GAUSS formula string syntax and allows users to load and transform specific variables directly from the dataset.

new;
library tsmt;

// Load data and get x and y
rolling_data = loadd(getGAUSSHome() $+ "pkgs/tsmt/examples/rolling");
yt_break = rolling_data[.,1];
xt = rolling_data[.,2:4];

Estimate the Model

The function rolling returns three outputs, a vector of estimated residuals, one-step-ahead rolling residuals, and standardized one-step-ahead residuals.

// First set parameters to run a rolling window regression
// Positive window sets fixed window
wind = 15;

// Start date
dtstart = 1947;

// Frequency
freq = 12;

// Fixed window regression
{ beta_roll, res_roll, w_roll } = rolling(yt_break, xt, wind, 0, 1, dtstart, freq);

Output

In addition the three returns, the procedure produces the graph shown at the top of this page.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.