Returns the deviance of a fitted model object.
Usage
# S3 method for spmod
deviance(object, ...)
Arguments
- object
A fitted model object from splm()
or spautor()
where estmethod
is "ml"
or "reml"
.
- ...
Other arguments. Not used (needed for generic consistency).
Details
For spmod
objects estimated using "ml"
or "reml"
,
the deviance is \((y - X \beta)^T V (y - X \beta)\) for an inverse
covariance matrix \(V\), analogous
to residual sums of (whitened) squares.
Examples
spmod <- splm(z ~ water + tarp,
data = caribou,
spcov_type = "exponential", xcoord = x, ycoord = y
)
deviance(spmod)
#> [1] 26