I need to find the probability of sampling a specific point on a Gaussian Distribution.

The catch is that the mean of the first Gaussian Distribution is itself sampled from a Gaussian Distribution.

The standard deviation is known, and the mean of the second distribution is 0.

So, calling the variable to sample y:

$ x \sim N(0, \rho) $

$ y\mid x \sim N(x, \sigma) $

To find out the probability of sampling y, I believe I should resolve:

$$ p(y) = \int^{+\infty}_{-\infty} p(y \mid x) \, p(x) \;\mathrm{d}x= \int^{+\infty}_{-\infty} \frac{1}{\sigma \sqrt{2 \pi}} \mathrm{e}^{- \frac{(y-x)^2}{2\sigma^2}} \frac{1}{\rho \sqrt{2 \pi}} \mathrm{e}^{- \frac{x^2}{2\rho^2}}\;\mathrm{d}x $$

which is the probability of sampling y from a Gaussian centered in x times the probability of sampling x from the other Gaussian, for every x.

I tried resolving it on wolframalpha but unfortunately it only works when you specify the standard deviations, while I'd like to have it parametric ( the experession will be evaluated in a program)

I also looked on the internet, but I only found situations in which both the normal distributions depended on the same variable.

I started deriving it by hand, but my calculus exam was long ago and I'm not sure I can do it correctly anymore and unfortunately I don't know any numerical computation program (like Matlab, Scilab, etc)

How can I resolve the given integral to obtain an expression which only depends on y, $\sigma$ and $\rho$?

  • 1
    $\begingroup$ You might want to join forces with the author of this other question (and find a complete answer there). In your notations, $y\sim N(0,\sqrt{\rho^2+\sigma^2})$. $\endgroup$ – Did Feb 20 '16 at 9:57
  • $\begingroup$ The question you linked it extremely relevant! Thanks! Might you explain how you reached $ y \sim N(0, \sqrt{\rho^2 + \sigma^2}) $? If you mean that y is distrubted like that, you actually solved my question! It also makes sense from my experiments with various options for $\rho$ and $\sigma$ on wolfram $\endgroup$ – Makers_F Feb 20 '16 at 10:35
  • $\begingroup$ @Did I think this is the explaination math.stackexchange.com/questions/1663907/… Can you write that as an answer here, so that I can accept it and give you your deserved points? :) $\endgroup$ – Makers_F Feb 20 '16 at 10:41
  • $\begingroup$ This is rather standard: en.wikipedia.org/wiki/… $\endgroup$ – Did Feb 20 '16 at 11:23

The value of the double defined integral is : $\quad\frac{1}{\sqrt{2\pi (\sigma^2+\rho^2) }}e^{-\frac{y^2}{2(\sigma^2+\rho^2)}}$

enter image description here

  • $\begingroup$ Note that the integral proposed by you is different from the one in my question. More specifically, the second term in the integral should not depend on y (as that normal is centered on 0 and x is the variable). Am I correct? $\endgroup$ – Makers_F Feb 20 '16 at 10:50
  • $\begingroup$ The integral is the same as yours. I fact there was a muddle in typing. It is corrected now. $\endgroup$ – JJacquelin Feb 20 '16 at 11:10
  • $\begingroup$ Thanks! How would that change if we had multivariate normals instead? In my case the covariance matrix would be diagonal, so we can assume the components of the result vector are independant $\endgroup$ – Makers_F Feb 20 '16 at 11:45
  • $\begingroup$ That's something else. You may open another question with the spécifications of the integral and the symbols used in order to make consistent the answers. $\endgroup$ – JJacquelin Feb 20 '16 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.