Find a shifted version of a matrix, adjusting the time base backward (lagged)
or forward (leading) by a specified number of observations for each column.
Usage
lagmatrix(x, lag)
Value
A matrix with the same class and size as x.
Arguments
x
A matrix or multivariate time series.
lag
A vector of lags (positive values) or leads (negative values) with
a length equal to the number of columns of x.