swh:1:snp:4a47993778f3ff3fe6e227d2f4c1a7654fd94e50
Tip revision: bd393fa1bdd7a624be65d65cc799865503ecf8df authored by Brian Ward on 09 February 2024, 14:44:15 UTC
Merge pull request #226 from stan-dev/add-json-data-files
Merge pull request #226 from stan-dev/add-json-data-files
Tip revision: bd393fa
radon.2.stan
data {
int<lower=0> N;
int<lower=0> J;
vector[N] y;
array[N] int<lower=0, upper=1> x;
array[N] int county;
vector[J] u;
}
parameters {
array[J] real a;
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);
}
}