deviance.vlmc {VLMC} | R Documentation |
Compute the Deviance of a Fitted VLMC Object
Description
Compute the Deviance, i.e., - 2 log[likelihood(*)] of a fitted VLMC object. The log-likelihood is also known as “entropy”.
Usage
## S3 method for class 'vlmc'
deviance(object, ...)
Arguments
object |
typically the result of |
... |
possibly further arguments (none at the moment). |
Value
A number, the deviance, i.e., - 2 log.likelihood(*)
.
where the log.likelihood is really what we currently have
as entropy()
.
Author(s)
Martin Maechler
See Also
Examples
example(vlmc)
deviance(vlmc.pres)
devianceR <- function(object)
{
dn <- dimnames(pr <- predict(object))
-2 * sum(log(pr[cbind(2:nrow(pr), match(dn[[1]][-1], dn[[2]]))]))
}
all.equal(deviance(vlmc.pres), devianceR(vlmc.pres), tol = 1e-14)
[Package VLMC version 1.4-3-1 Index]