 be more stable to compute densities on the log scale. Taking the logarithm and pushing it through results in a stable computation, <span class="math display">\[\begin{eqnarray*}
\log p(\tilde{y} \mid \tilde{x}, x, y)
&amp; \approx &amp;
\log \frac{1}{M} \sum_{m = 1}^M p(\tilde{y} \mid \tilde{x}, \theta^{(m)}),
\\[4pt]
&amp; = &amp; -\log M + \log \sum_{m = 1}^M p(\tilde{y} \mid \tilde{x}, \theta^{(m)}),
\\[4pt]
&amp; = &amp; -\log M + \log \sum_{m = 1}^M \exp(\log p(\tilde{y} \mid \tilde{x}, \theta^{(m)}))