R/deviance.R

Defines functions deviance.Owl

Documented in deviance.Owl

#' Model deviance
#'
#' @param object an object of class `'Owl'`.
#' @param ... ignored
#'
#' @return For Gaussian models this is twice the residual sums of squares. For
#'   all other models, two times the negative loglikelihood is returned.
#' @export
#'
#' @examples
#' fit <- owl(heart$x, heart$y, family = "binomial")
#' deviance(fit)
deviance.Owl <- function(object, ...) {
  deviance_ratio <- object$deviance_ratio
  null_deviance <- object$null_deviance

  (1 - deviance_ratio) * null_deviance
}

Try the owl package in your browser

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

owl documentation built on Feb. 11, 2020, 5:09 p.m.