There's more...
We have used gamma priors in order to force the beta coefficients to be greater than zero. But in STAN, we have a different option: we can put a boundary via real<lower=0> beta[6]. This is sufficient to ensure that the posterior densities are bounded by zero. Apart from this, we may or may not want to specify a prior density, which we can do, for example, using beta ~ normal(5,3). It is very important to note that, in these cases (when using the <lower> approach), that we are actually specifying improper priors, which are priors that have a density that doesn't sum up to one (a Gaussian density is defined from -∞ to ∞ and has an area of 1). But if the permissible range for this variable is now from 0 to ∞, that area-integral ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access