Get graph representation from Stan model

How to get a graph representation like this:

From Stan model like this:

6 model <- "
7 // BART Model of Risky Decision-Making
8 data {
9 int<lower=1> nconds;
10 int<lower=1> ntrials;
11 real<lower=0,upper=1> p;
12 int<lower=1> options[nconds,ntrials];
13 int d[nconds,ntrials,30];
14 }
15 parameters {
16 vector<lower=0>[nconds] gplus;
17 vector<lower=0>[nconds] beta;
18
19 // Priors
20 real<lower=0,upper=10> mug;
21 real<lower=0,upper=10> sigmag;
22 real<lower=0,upper=10> mub;
23 real<lower=0,upper=10> sigmab;
24 }
25 transformed parameters {
26 vector<lower=0>[nconds] omega;
27
28 // Optimal Number of Pumps
29 omega <- -gplus / log1m§;
30 }
31 model {
32 for (i in 1:nconds) {
33 gplus[i] ~ normal(mug, sigmag)T[0,];
34 beta[i] ~ normal(mub, sigmab)T[0,];
35 }
36 // Choice Data
37 for (i in 1:nconds) {
38 for (j in 1:ntrials) {
39 for (k in 1:options[i,j]) {
40 real theta;
41 theta <- 1 - inv_logit(-beta[i] * (k - omega[i]));
42 d[i,j,k] ~ bernoulli(theta);
43 }
44 }
45 }

1 Like

There’s no way to do that. Stan doesn’t even necessarily define a graphical model. And producing good diagrams requires some layout decisions that may be hard to do automatically.

Having said all that, how did you register for this list? I thought this was supposed to be our dev list until we’ve tried it out and opened a users list in this format.

Thanks for the reply!
Is it for the dev list? Sorry… I register through GitHub.

We’re not trying to keep it private or anything. It’s just that we required users to request to register for the dev lists when we were hosting it on Google. I’m not maintaining this, so was just curious as to what was going on.