Exercise

# Define, compile, & simulate the regression model

Upon observing the relationship between weight \(Y\)_{i} and height \(X\)_{i} for the 507 subjects \(i\) in the `bdims`

data set, you can update your *posterior* model of this relationship. To build your posterior, you must combine your insights from the likelihood and priors:

**likelihood:**\(Y\)_{i}\(\sim N(m\)_{i}, \(s^2)\) where \(m\)_{i}\(= a + b X\)_{i}**priors:**\(a \sim N(0, 200^2)\), \(b \sim N(1, 0.5^2)\) and \(s \sim Unif(0, 20)\)

In this series of exercises, you'll **define**, **compile**, and **simulate** your Bayesian regression posterior. The `bdims`

data are in your work space.

Instructions 1/3

**undefined XP**

**DEFINE** your Bayesian model.

- Define the likelihood model of
`Y[i]`

given`m[i]`

and`s`

where`m[i] <- a + b * X[i]`

. - Specify the priors for
`a`

,`b`

, and`s`

. - Store the
*model string*as`weight_model`

.