Function to calculate deviance given two vectors of observed and predicted values. Requires a family argument which is set to binomial by default
calc.deviance(obs, pred, weights = rep(1,length(obs)),
family="binomial", calc.mean = TRUE)
a vector with observed values
a vector with predicted values that correspond the the values in obs
a vector of weight values
One of "binomial", "bernoulli", "poisson", "laplace", or "gaussian"
Logical. If TRUE
, the mean deviance is returned
John R. Leathwick and Jane Elith