swh:1:snp:4a47993778f3ff3fe6e227d2f4c1a7654fd94e50
Raw File
Tip revision: 0e74e600d5fc42bfa14480494078233ca21b94c6 authored by Rob Trangucci on 05 December 2014, 20:19:11 UTC
Test commit
Tip revision: 0e74e60
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);
}  
back to top