laggedMatrix: Create a matrix with lagged columns

Description Usage Arguments Value Note See Also Examples

View source: R/laggedMatrix.R

Description

Create a matrix with

Usage

1

Arguments

x

a vector

k

number of columns, with lag = 0:(k-1).

Value

a matrix with k + length(x) -1 rows and k columns.

Note

This is a rather special function. Use acf for correct estimation of autocorrelation and arima for fitting time-series models.

See Also

acf, arima

Examples

1
2
3
4
x <- sort(runif(100))
xx <- laggedMatrix(x, 3)
matplot(xx)
cor(na.omit(xx))

rsachse/limnotools documentation built on Jan. 8, 2021, 5:37 a.m.