1. A simple Bayesian regression model
In Chapters 1 & 2 you explored the foundations of Bayesian modeling in RJAGS through the settings of two simple models, the Beta-Binomial and Normal-Normal.
2. Chapter 3 goals
You'll engineer a more flexible model in Chapter 3: a simple Bayesian regression model. This will lay the groundwork for more advanced models in Chapter 4.
Further, you'll learn how to define, compile, and simulate regression models in RJAGS
and how to use the resulting simulation output for posterior inference and prediction.
3. Modeling weight
Throughout this chapter, you'll follow the same intuitive example: the modeling of human weights. Let $Y_i$ be the weight of adult $i$ in kg.
We can safely assume that weights are Normally distributed around some mean weight $m$ with standard deviation $s$. You saw a similar setup in Chapter 2 and, to complete the Bayesian model, built priors for the $m$ and $s$ parameters. In building the priors here, consider incorporating a known predictor of weight.
4. Modeling weight by height
For example, the relationship between weight and height is known to be positive and linear.
5. Modeling weight by height
To incorporate this information into our model, we can say that weights $Y_i$ are Normally distributed around mean $m_i$, the $i$ subscript denoting the dependence of $m_i$ on the corresponding height $X_i$.
6. Modeling weight by height
Since this dependence is linear, $m_i$ takes the form of a simple regression line, $a + b X_i$.
7. Modeling weight by height
Thus we can think of $m_i$ as the typical weight $Y_i$ among adults with a shared height $X_i$.
8. Modeling weight by height
Not all adults of this height weigh the same amount. Rather, weights vary Normally around $m_i$ with standard deviation $s$.
9. Modeling weight by height
As height increases, so too does the typical weight.
10. Modeling weight by height
11. Bayesian regression model
Great! Now that we've engineered the likelihood structure, we can complete the Bayesian model specification by building priors for the parameters. In this model, there are 3:
$y$-intercept $a$ specifies the value of $m_i$ when $X_i$ is 0;
slope $b$ measures the rate of change in weight per 1 cm increase in height;
and residual standard deviation $s$ measures the degree of individual deviation from trend $m_i$ at height $X_i$.
12. Priors for the intercept & slope
We'll start by engineering priors for the intercept and slope parameters. Conservatively, most adults fall within the red box, having heights between 115 & 225 cm and weights between 10 & 150 kg.
13. Priors for the intercept & slope
The collection of gray lines here represent prior plausible linear models of weight vs height. First, the mostly positive slopes of these lines represent our strong prior knowledge that weight tends to increase with height.
In fact, the collection of these slopes is Normally distributed around 1 kg/cm with a standard deviation of 0.5 kg/cm. This is our prior model of slope $b$.
14. Priors for the intercept & slope
We have less prior certainty about the y-intercept parameter $a$. The unique y-intercepts of the gray lines, represented by the red dots, are Normally distributed around 0 kg with a large standard deviation of 200 kg. This level of uncertainty produces some prior plausible models that don't even pass through the red box. However, it also preserves the flexibility needed for $a$ to change in concert with slope $b$.
15. Prior for the residual standard deviation
Finally, consider the residual standard deviation parameter $s$. We're relatively uncertain about the strength of the relationship between weight and height. Individual deviation from the trend, $s$, might be very small (as it is here).
16. Prior for the residual standard deviation
Or quite large. To accommodate this uncertainty, we select a vague uniform prior:
$s$ is uniformly likely to be anywhere from 0 to 20 kg.
17. Bayesian regression model
Putting this all together, we've engineered a simple Bayesian regression model.
18. Let's practice!
In the next exercises, you'll build insights into the relationship between weight and height from the prior models and data on a sample of 507 adults.