Description Usage Arguments Value Author(s) Examples
View source: R/deviancePoisson.R
This function calculates a deviance measure for model predictions assuming a Poisson distribution.
1 | deviancePoisson(Y, Y_hat)
|
Y |
a numeric vector of observations. |
Y_hat |
a numeric vector of predictions for Y (must have same length as Y.) |
a numeric vector.
Edwin Graham <edwingraham1984@gmail.com>
1 2 3 4 5 6 7 8 9 10 | # n <- 1000
#
# true <- runif(n, 0, 3)
# observed <- rpois(n, true)
# predicted <- exp(log(1.5)/2 + log(true)/2 + rnorm(n, sd=0.1))
#
# plot(observed, predicted)
#
# devs <- deviancePoisson(observed, predicted)
# sum(devs)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.