LagReg: Lagged Regression

View source: R/LagReg.R

LagRegR Documentation

Lagged Regression

Description

Performs lagged regression as discussed in Chapter 4.

Usage

LagReg(input, output, L = c(3, 3), M = 40, threshold = 0, 
        inverse = FALSE)

Arguments

input

input series

output

output series

L

degree of smoothing; see spans in the help file for spec.pgram.

M

must be even; number of terms used in the lagged regression

threshold

the cut-off used to set small (in absolute value) regression coeffcients equal to zero

inverse

if TRUE, will fit a forward-lagged regression

Details

For a bivariate series, input is the input series and output is the output series. The degree of smoothing for the spectral estimate is given by L; see spans in the help file for spec.pgram. The number of terms used in the lagged regression approximation is given by M, which must be even. The threshold value is the cut-off used to set small (in absolute value) regression coeffcients equal to zero (it is easiest to run LagReg twice, once with the default threshold of zero, and then again after inspecting the resulting coeffcients and the corresponding values of the CCF). Setting inverse=TRUE will fit a forward-lagged regression; the default is to run a backward-lagged regression. The script is based on code that was contributed by Professor Doug Wiens, Department of Mathematical and Statistical Sciences, University of Alberta.

Value

Graphs of the estimated impulse response function, the CCF, and the output with the predicted values superimposed.

beta

Estimated coefficients

fit

The output series, the fitted values, and the residuals

Note

See Chapter 4 of the text for an example.

Author(s)

D.S. Stoffer

References

You can find demonstrations of astsa capabilities at FUN WITH ASTSA.

The most recent version of the package can be found at https://github.com/nickpoison/astsa/.

In addition, the News and ChangeLog files are at https://github.com/nickpoison/astsa/blob/master/NEWS.md.

The webpages for the texts and some help on using R for time series analysis can be found at https://nickpoison.github.io/.


astsa documentation built on May 29, 2024, 10:29 a.m.