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.

118 4. LINEAR MODELS(1) Use link to generate distributions of posterior values for µ. e default behaviorof link is to use the original data, so you have to pass it a list of new horizontalaxis values you want to plot posterior predictions across.(2) Use summary functions like mean or HPDI or PI to find averages and lower andupper bounds of µ for each value of the predictor variable.(3) Finally, use plotting functions like lines and shade to draw the lines and intervals.Or you might plot the distributions of the predictions, or do further numericalcalculations with them. It’s really up to you.is recipe works for every model we fit in the book. As long as you know how parametersrelate to the data, you can use samples from the posterior to sample predictions.Rethinking: Overconfident confidence intervals. e confidence interval for the regression line inFIGURE 4.8 clings tightly to the MAP line. us there is very little uncertainty about the averageheight as a function of average weight. But you have to keep in mind that these inferences are alwaysconditional on the model. Even a very bad model can have very tight confidence intervals. It mayhelp if you think of the regression line in FIGURE 4.8 as saying: conditional on the assumption thatheight and weight are related by a straight line, then this is the most plausible line, and these are itsplausible bounds.Overthinking: How link works. e function link is not really very sophisticated. All it is doingis using the formula you provided when you fit the model to compute the value of the linear model.It does this for each sample from the posterior distribution, for each case in the data. You couldaccomplish the same thing for any model, fit by any means, by performing these steps yourself. isis how it’d look for m4.3.R code4.54post

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

Saved successfully!

Ooh no, something went wrong!