R/dS2_nlin2_test.R

Defines functions dS2_nlin2_test

Documented in dS2_nlin2_test

dS2_nlin2_test <- function(dS2, thetaN, alpha, y, exact = FALSE) {
  if (missing(dS2)) {
    dS2 <- rexpar::dS2_nlin2(theta = thetaN, y = y)
  }
  NdS2 <- sqrt(floor((length(y) - 1) / 4) - 1) * (dS2 - 1 / 8) / sqrt(7 / 64)
  if (exact) {
    deci <- ((dS2 * (floor((length(y) - 1) / 4) - 1)) <
               qbinom(alpha, size = (floor((length(y) - 1) / 4) - 1), prob = 1 / 8))
  } else {
    deci <- (NdS2 < qnorm(alpha))
  }
  list(TS = NdS2, phi = deci)
}
ChrisKust/rexpar documentation built on May 6, 2019, 11:48 a.m.