= Solution
One simple algorithm is <importance sampling> from the prior. Draw $(\theta_j,\boldsymbol\alpha_j)$ independently from $\pi(\theta)\pi(\boldsymbol\alpha)$ and assign weight $w_j=L_A(\theta_j,\boldsymbol\alpha_j)$. Then
$$
\widehat{\mathcal Z}_A=\frac1J\sum_{j=1}^Jw_j
$$
estimates the <Bayesian model evidence>, and the normalized weights $w_j/\sum_kw_k$ represent the posterior. A weighted histogram or <kernel density estimation> of the $\theta_j$ estimates the marginal $\mathcal P_A(\theta)$; discarding $\boldsymbol\alpha_j$ performs the marginalization.
Back to article page