Evaluation of the integral of a linear gaussian model?

151 Views Asked by At

suppose the following $$P(x_1) \text{ ~ } N(7.3555\ ; 12.3433)$$ and $$P(x_2|x_1) \text{ ~ } N(0.995\ + \ 0.2351x_1\ ;13.732)$$ how to evaluate the following integral?

\begin{align*} \int \mathcal{I}_{x_2 \geq 20} p(x_1 | x_2)dP = & \int_{20}^{\infty} \int_{-\infty}^{\infty} \frac{1}{\sqrt{2\pi(12.3433)}} \exp \left\{ - \frac{(x_1 - 7.3555)^2} {2(12.3433)} \right\} \\ & \frac{1}{\sqrt{2\pi(13.732)}} \exp \left\{ - \frac{(x_2 - (0.995 + 0.2351x_1))^2}{2(13.732)} \right\} dx_1 \, dx_2 \ \end{align*}

EDIT$$$$ The context of this question appeared while I was trying to understand more deeply how to infer in a hybrid bayesian network, there are several R packages that do that but I just wanted to get the math underlying it. the joint probability was easy to calculate for both the discrete case and the hybrid case to solve, but the marginals I couldn't solve it. the the wikipedia page says $$\int_{-\infty}^{\infty} e^{-a(x+b)^2}\,dx= \sqrt{\frac{\pi}{a}}.$$ But I couldn't generalise it to the case of a linear gaussian where the mean is unknown and its just a linear combination of its continuous parents.

1

There are 1 best solutions below

5
On BEST ANSWER

Firstly you use $$\int_{-\infty}^{\infty} e^{-a x^2+b x+c} dx = \frac{\sqrt{\pi } e^{\frac{b^2}{4 a}+c}}{\sqrt{a}}$$ to reduce it to a single integral, after that $$\int_{A}^{\infty} e^{-a x^2+b x+c} dx =\frac{\sqrt{\pi } e^{\frac{b^2}{4 a}+c} \left(\text{erf}\left(\frac{b-2 a A}{2 \sqrt{a}}\right)+1\right)}{2 \sqrt{a}}$$ to compute the remaining integral