R/ad.R

Defines functions ad

Documented in ad

ad <- function(r, P) {

  n <- length(r)

  P <- c(P)[order(c(r))]

  P_rev <- 1 - rev(P)

  -n - sum(seq(1, 2*n, 2)*log(P * P_rev))/n

}

Try the spc4sts package in your browser

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

spc4sts documentation built on May 24, 2022, 5:07 p.m.