tsmat function

tsmat constructs a (n-p+1,p) matrix from a time series where the first column is the shortened series y[p],...,y[n], the second is y[p-1],...,y[n-1], etc.

tsmat constructs a (n-p+1,p) matrix from a time series where the first column is the shortened series y[p],...,y[n], the second is y[p-1],...,y[n-1], etc.

tsmat(y, p)

Arguments

  • y: the series, a vector or a time series of length n
  • p: desired number of columns

Returns

mat (n-p+1,p) matrix

Examples

out <- tsmat(c(1:20),4)
  • Maintainer: Rainer Schlittgen
  • License: GPL
  • Last published: 2021-10-30

Useful links