From e500ef5fe9c97a98ab41b5b0bc5ad69dd3315350 Mon Sep 17 00:00:00 2001 From: "Jachym.Barvinek" Date: Sun, 4 Aug 2024 15:10:41 +0200 Subject: [PATCH] stan demos --- assets/stan_demos/network.stan | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 assets/stan_demos/network.stan diff --git a/assets/stan_demos/network.stan b/assets/stan_demos/network.stan new file mode 100644 index 0000000..f52d1df --- /dev/null +++ b/assets/stan_demos/network.stan @@ -0,0 +1,16 @@ +data { + int N; + array[N] int r, s, w; +} +parameters { + real pr; + array[2] real ps; + array[2, 2] real 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]]); + } +}