R: Construct predictor blocks for time series models

tsBlocks {robustHD} | R Documentation

## Construct predictor blocks for time series models

### Description

Construct blocks of original and lagged values for autoregressive time series models with exogenous inputs. The typical use case is to supply the output as `newdata` argument to the `predict` method of robust groupwise least angle regression models.

### Usage

    tsBlocks(x, y, p = 2, subset = NULL, intercept = TRUE)

### Arguments

`x` | a numeric matrix or data frame containing the exogenous predictor series.
`y` | a numeric vector containing the response series.
`p` | an integer giving the number of lags to include (defaults to 2).
`subset` | a logical or integer vector defining a subset of observations from which to construct the matrix of predictor blocks.
`intercept` | a logical indicating whether a column of ones should be added to the matrix of predictor blocks to account for the intercept.

### Value

A matrix containing blocks of original and lagged values of the time series `y` and `x`.

### Author(s)

Andreas Alfons

### See Also

`predict.tslars`, `tslars`, `predict.tslarsP`, `tslarsP`

[Package robustHD version 0.7.2 Index]