measure_deviance function

Estimate the deviance