R/loc0.test.R

Defines functions loc0.test

Documented in loc0.test

loc0.test <- function(y, tol = 1e-7) {
  lik0 <- CCd::cc.mle0(y, tol = tol)$loglik
  lik1 <- CCd::cc.mle(y)$loglik
  stat <- 2 * lik1 - 2 * lik0
  pvalue <- pchisq(stat, 1, lower.tail = FALSE)
  res <- c(stat, pvalue)
  names(res) <- c("test statistic", "p-value")
  res
}

Try the CCd package in your browser

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

CCd documentation built on April 4, 2025, 2:21 a.m.