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 }