I am trying to build the following model:

For 1\leq i \leq k

p_i \sim Beta(\alpha_i, \beta_i)

Where the \{ p_i\} are correlated through a gaussian copula with a given covariance \Sigma

B_i \sim Bernoulli(p_i)

Q=\prod_i p_i

I have observations of \{B_i\} with some missing data.

How do i sample from the posterior distribution of Q?

Also, how do i do it with a custom distribution instead of *beta*?