R/var_kendall_S.R

Defines functions var_kendall_S

Documented in var_kendall_S

#' Variance of Kendall correlation S statistic under null hypothesis of no trend and assuming independence
#' 
#' @param x numeric, a time series (only its length is used)
#' @return the variance (a number)
#' 
#' @author Ken Butler, \email{butler@utsc.utoronto.ca}
#' 
#' @examples
#' var_kendall_S(rnorm(100))
#' 
#' @export
#' 
var_kendall_S <-
function(x) {
  n=length(x)
  n*(n-1)*(2*n+5)/18
}
nxskok/mkac documentation built on Jan. 15, 2024, 4:02 a.m.