Bernoulli deviance

bernoulli_dev(obs, pred)

Arguments

obs

numeric; observed values.

pred

numeric; predicted values.

Value

A named numeric vector with three elements: model deviance, mean deviance, and deviance explained.

Examples

obs <- c(1, 1, 1, 0, 0, 0)
pred <- c(0.9, 0.8, 0.7, 0.3, 0.1, 0.2)
ebirdst:::bernoulli_dev(obs, pred)
#>     deviance_model      deviance_mean deviance_explained 
#>         -2.7407160         -8.3177662          0.6704985