Skip to contents

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, ...)

Arguments

object

An object of class "MortalityLaw".

...

Further arguments passed to or from other methods.

Value

The deviance for a single fit, or a named vector of deviances for a multiple fit.

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