Alex
Alex

Reputation: 19803

acf function in R return values

I would like to compute a simple acf in R. For example, consider:

v = acf(1:10, plot=F)

v now contains an element called lag which is a 3-dim array containing the last used in the estimation. How come this array is 3 dimensional and not simply 1 dimensional? I am asking because I would like to foresee exactly what will be in each dimension depending on the use-case.

Upvotes: 0

Views: 1365

Answers (1)

John Paul
John Paul

Reputation: 12664

You can have more than one column in your input data.

Try:

v = acf(data.frame(x=rnorm(10), y=rnorm(10)), plot=F)

then you get an array. I believe this is used for multivariate time series

Upvotes: 1

Related Questions