Statistics, Data Science, Analytics, Business Intelligence, Machine Learning.
function(x) rnbinom(n = 1, size = 0.8, mu = exp(x)) ) model_correct <- glm(y_poisson~x_val, family = 'poisson') model_wrong <- glm(y_negbin~x_val, family = 'poisson') plot( fitted(model_correct), residuals(model_correct, type = 'pearson'), main = 'Good fit', ylab = 'Pearson residuals', xlab =