Returns the deviance of a "MortalityLaw" fit. For a fit entered
from death counts and exposures (Dx, Ex) it is the Poisson
deviance, the quantity opt.method = "poissonL" minimises. For a fit
entered from rates (mx or qx) there is no count likelihood,
so it is the sum of squared log-residuals.
Usage
# S3 method for class 'MortalityLaw'
deviance(object, ...)Examples
x <- 45:75
M1 <- MortalityLaw(x = x, Dx = ahmd$Dx[as.character(x), "1950"],
Ex = ahmd$Ex[as.character(x), "1950"],
law = "makeham", opt.method = "poissonL")
deviance(M1)
#> [1] 108.9142