Skip to content

Commit

Permalink
stan demos
Browse files Browse the repository at this point in the history
  • Loading branch information
Jachym.Barvinek committed Aug 4, 2024
1 parent 474e60e commit e500ef5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions assets/stan_demos/network.stan
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
data {
int<lower=1> N;
array[N] int<lower=0,upper=1> r, s, w;
}
parameters {
real<lower=0,upper=1> pr;
array[2] real<lower=0,upper=1> ps;
array[2, 2] real<lower=0,upper=1> pw;
}
model {
for (i in 1:N) {
r[i] ~ bernoulli(pr);
s[i] ~ bernoulli(ps[r[i]]);
w[i] ~ bernoulli(pw[r[i], s[i]]);
}
}

0 comments on commit e500ef5

Please sign in to comment.