I have a model with a marginal likelihood of the following form:
$$\mathcal{L}(\theta_1, \theta_2, \theta_3|\{x_{i,j}\}_{i=1, j=1}^{N, M_i})=\prod_{i=1}^{N}\int_{0}^{1} f(p_i;\theta_1) \prod_{j=1}^{M_i}\big(p_i g(x_{i,j};\theta_2)+(1-p_i) h(x_{i,j};\theta_3)\big)dp_i$$
I wish to numerically solve for $(\theta_1, \theta_2, \theta_3)$ that maximizes the above likelihood. The issue is that the distributions $G$ and $H$ are fairly sharp-peaked, and therefore, the product over $M_i$ tends to very quickly explode to infinity. Usually, in MLE, logging the likelihood fixes this, but I obviously can't bring the log inside an integral. Are there any numerical workarounds or different optimization methods that handle this type of marginalized likelihood?