Hello all,

In order to do parametric bootstrapping for ABNs, I need to perform Bayesian regression on given data and then construct marginal posteriors of the parameters, which I will use to simulate new data for the network. Considering the simple network A -> B, where both variables are normally distributed, we have five parameters: beta_A0, beta_B0, beta_B1, sigmaA, and sigmaB, which gives

A ~ N(beta_A0, sigmaA) and

B ~ N(beta_B0 + beta_B1 * A, sigmaB)

I implemented the regression as follows:

data {

int N;

vector[N] B;

vector[N] A;

}

parameters {

real betaA0; //Intercept of A

real sigmaA; //Standard deviation of A

real betaB0; //Intercept of B

real betaB1; //Slope of B

real sigmaB; //Standard deviation of B

}

model {

betaA0 ~ cauchy(0,10); //prior for the intercept following Gelman 2008

betaB0 ~ cauchy(0,10); //prior for the intercept following Gelman 2008

betaB1 ~ cauchy(0,2.5);//prior for the slopes following Gelman 2008

A ~ normal(betaA0, sigmaA);

B ~ normal(betaB0 + betaB1 * A, sigmaB);

}

Now, Iâ€™m quite confused about the construction of the marginal posteriors. Do I need to apply a marginalization forumula as it is done in the â€śLatent discrete parametersâ€ť section in the manual or can I just use something like

categorical_rng(softmax(betaA0))

Any help or pointing in the right direction would be greatly appreciated.

Best Marco

(edit: uploaded incomplete topic by accident)