R/trid.R

Defines functions trid

Documented in trid

trid <- function(x) {
  d <- length(x)
  term1 <- sum((x - 1)^2)
  term2 <- sum(sapply(2:d, function(i) x[i] * x[i-1]))
  return(term1 - term2)
}

Try the EEEA package in your browser

Any scripts or data that you put into this service are public.

EEEA documentation built on June 10, 2025, 9:13 a.m.