R/evidence.R

evidence <- function(x, y, type = c("AIC", "AICc", "BIC"))
{
  type <- match.arg(type)

  if (!is.numeric(x) && !is.numeric(y)) {
    x1 <- switch(type, AIC = AIC(x), AICc = AICc(x), BIC = BIC(x))
    y1 <- switch(type, AIC = AIC(y), AICc = AICc(y), BIC = BIC(y))
  } else {
    if (is.numeric(x) && is.numeric(y)) {
      x1 <- x
      y1 <- y
    } else {
      stop("Input must (both) be either a fitted model or numeric!")
    }
  }  	
	1/(exp(-0.5 * (y1 - x1)))	
}

Try the qpcR package in your browser

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

qpcR documentation built on May 2, 2019, 5:17 a.m.