swh:1:snp:4a47993778f3ff3fe6e227d2f4c1a7654fd94e50
Tip revision: 5272bdc62fb3e8845c1b071ad04560f06f4cbcb8 authored by Bob Carpenter on 12 April 2017, 17:34:23 UTC
Merge pull request #67 from stan-dev/feature/knitr-curse-dims
Merge pull request #67 from stan-dev/feature/knitr-curse-dims
Tip revision: 5272bdc
radon.2.stan
data {
int<lower=0> N;
int<lower=0> J;
vector[N] y;
int<lower=0,upper=1> x[N];
int county[N];
vector[J] u;
}
parameters {
real a[J];
real b;
real g_0;
real g_1;
real<lower=0> sigma_y;
real<lower=0> sigma_a;
}
model {
for (j in 1:J)
a[j] ~ normal(g_0 + g_1 * u[j], sigma_a);
for (n in 1:N)
y[n] ~ normal(a[county[n]] + b * x[n], sigma_y);
}