12 Lecture 03 - 2019
12.1 Regressions
- Model of mean and variance of some normally distributed measure
- Mean as additive combination of weighted variables
- Typical assumed constant variable (???)
- The line returned is the mean - but with Bayesian we want to see the distribution of lines, ranked by plausibility
- The model endorses the line, but the line doesn’t necessarily fit the data
- In regressions there will always be more certainty at the means and bow tie towards the limits of the data
- Regression models don’t have arrows like DAGs - they just measure associations.
12.2 Normal distributions
Normal distributions arise when repeated fluctuations tend to cancel near 0
The Gaussian distribution is the most conservative distribution to use for a prior, it is the best option if no additional scientific information is available
12.3 Prior predictive distributions
Simulate from the joint posterior distribution and evaluate
- Setup model with
quap
prior <- extract.prior(model)
-
link(model, post = prior, data = seq)
- where the seq is a sequence of your x variable (eg for standardize -2, 2
- Plot lines
These are all the possibility given the prior, not the data
If the lines show such a limited relationship that you’d expect that the true relationship is outside of these, expand the priors.
If alternatively they are widely implausible, tighten the priors.
12.4 Quadratic approximate
In a multidimensional space, QUAP uses gradient climbing to find peaks
Maximum likelihood estimation = QUAP with flat priors
Function in rethinking is rethinking::quap