11.07.2015 Views

statisticalrethinkin..

statisticalrethinkin..

statisticalrethinkin..

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

330 12. MONSTERS AND MIXTURESPoisson that includes the speed limit variable. is suggests that most of the variation in thedata cannot be easily explained by the speed limit. You’ll see how the gamma-Poisson dealwith that variation, when we plot the predictions a little bit later.Before plotting, though, it’ll be useful to look at the parameter estimates. For modelm12.11, which dominates the model weights:R code12.38precis( m12.11 )Mean StdDev 2.5% 97.5%a 3.14 0.03 3.07 3.20s 2.19 0.34 1.53 2.85bl -0.19 0.06 -0.30 -0.07e estimate for the speed limit is negative, −0.19, and reliably below zero. is indicatesthat the speed limit did indeed reduce accidents, as assumed. But by how much? To find out,we have to reverse the link function, to get back on the count scale. e mean of the gammawill then, in turn, be the mean λ of the Poisson. e mean λ will be the mean observedcount. And so we just need to exponentiate the linear model to get an MAP predicted meannumber of accidents. Without and with the speed limit, the mean predictions are:R code12.39exp( 3.14 )exp( 3.14 - 0.19 )[1] 23.10387[1] 19.10595So the speed limit possibly reduced the number of accidents, on average, by 4 per day.Whether you think that is a lot or not depends upon how much you care about each accident.But the speed limit has done more than just reduce the mean. Since the variance ofcounts tend to scale with the mean, it has also reduced the variation in the number of accidents.Importantly, it may have reduced the high range of counts, such that there are manyfewer days with counts about, say, 30 or more, when the speed limit was in effect. In order tosee the data and predictions this way, we’ll need to plot the distribution of predictions, notjust consider the central estimate.I’ll provide the code here to plot the predicted distribution of counts over the empiricaldistribution, for days on which the speed limit was in effect. e reader should be able tomodify the code to produce the sister plot for days on which there was no speed limit. eplot will use samples from the posterior, as always. It’ll also explicitly compare the Poissonand gamma-Poisson predictions. Here’s the code:R code12.40post

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!