rankacf {corTESTsrd}R Documentation

Estimator of Spearman autocorrelations

Description

Computes Spearman-autocorrelations when the observations contain NAs. If the observations do not contain NAs, the function is consistent with the function acf applied to ranks.

Usage

rankacf(x,lag.max=length(x)-2)

Arguments

x

numeric input vector.

lag.max

maximum lag for which acf is estimated, automatically limited to one less than number of observations, should be positive integer.

Value

Estimated spearman autocorrelation up to lag.max.

Examples

x = rnorm(10)
rankacf(x)
acf(rank(x),plot=FALSE,lag.max = length(x)-2)$acf[-1,,1]

[Package corTESTsrd version 1.0-0 Index]