Conditional multivariate sampling

Since [X1, X2, X3] are some observed quantities, I would either model x_tilt = [X1[X3==3], X2[X3==3]] and find the posterior of x_tilt; or model X = [X1, X2, X3] directly and find the posterior of X, then compute the conditional of this posterior when X3==3.

The later cases you can use the code you have, and use sample_ppc after inference to generate large among of ppc samples, and plot the conditional:

index = (ppc['obs'][:, 2] > 2.99)  or (ppc['obs'][:, 2] < 3.01)
scatter(ppc['obs'][index, 0], ppc['obs'][index, 1])
1 Like