Results 1 to 8 of 8

Math Help - intersection point between gaussians

  1. #1
    Newbie
    Joined
    Aug 2008
    Posts
    6

    intersection point between gaussians

    Hi.
    I am doing a project in computer science where I have a need for determing the intersection point between two gaussians defined by their mean and standard variance e.g. g1(mu1,sigma1^2), g2(mu2,sigma2^2).

    How do i find their intersection point in the case where the two distributions only have a single intersection point?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Aug 2007
    From
    USA
    Posts
    3,111
    Thanks
    2
    Just set it up and solve it. After introducing logorithms, it is just a quadratic equation. It's a mess, but it's not any trickier than the Quadratic Formula.

    There are two complications, both are easily resolved.

    1) What to do with the solution you don't want and how to identify it. The desired intersection is the one between the means.

    2) If the variance matches, the quadratic solution is no good. You'll have to rely on symmetry.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Aug 2008
    Posts
    6
    Just as a sanity check for finding the intersection check i post my calculations for obtaining the quadratic equation.
    It have been a while since i have dealt with equations and i would be really glad if someone could confirm my derivation of the quadratic equation.

    Gaussian equation
     <br />
  y=\frac{1}{(2\pi sigma1^{2})^{1/2}}e^{-\frac{1}{2sigma1^{2}}*(x-mu1)^{2}}<br />

    intersection point between two gaussians:
     \frac{1}{(2\pi sigma1^{2})^{\frac{1}{2}}}e^{-\frac{1}{2sigma1^{2}}*(x-mu1)^{2}}=\\<br />
  \frac{1}{(2\pi sigma2^{2})^{\frac{1}{2}}}e^{-\frac{1}{2sigma2^{2}}*(x-mu2)^{2}}<br />

    remove the e:
    ln(\frac{1}{(2\pi sigma1^{2})^{1/2}}-\frac{1}{2sigma1^{2}}*(x-mu1)^{2}<br />
    =
    ln(\frac{1}{2\pi sigma2^{2})^{1/2})}-\frac{1}{2sigma2^{2}}*(x-mu2)^{2}<br />

    moving everything to one side of the equality sign:
    ln(\frac{1}{(2\pi sigma1^{2})^{1/2}})-ln(\frac{1}{(2\pi sigma2^{2})^{1/2}})
    <br />
-\frac{1}{2sigma1^{2}}*(x-mu1)^{2}+\frac{1}{2sigma2^{2}}*(x-mu2)^{2}=0<br />
    <br />
K= ln(\frac{1}{(2\pi sigma1^{2})^{1/2}})-ln(\frac{1}{(2\pi sigma2^{2})^{1/2}})<br />
    find the quadratic equation:
      K-\frac{1}{2sigma1^{2}}(x^{2}-2mu1*x+mu1^{2})+\frac{1}{2sigma2^{2}}(x^{2}-2mu2+mu2^{2})=0<br />

     (\frac{1}{2sigma1^{2}}+\frac{1}{2sigma2^{2}})x^{2}  +(\frac{1}{2sigma1^{2}}2mu1-\frac{1}{2sigma2^{2}}2mu2)x<br />
    +K-\frac{mu1^{2}}{2sigma1^{2}}+\frac{mu2^{2}}{2sigma2  ^{2}}=0<br />
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Aug 2008
    Posts
    6
    Ok, now i am confused.
    Is it possible to solve this equation as i have done by using a quadratic equation or is it not?

    I need the intersection point between the two means, and also know that gaussian1=/gaussian2.

    Best regards
    Susanne
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Flow Master
    mr fantastic's Avatar
    Joined
    Dec 2007
    From
    Zeitgeist
    Posts
    16,948
    Thanks
    5
    Quote Originally Posted by Susanne View Post
    Ok, now i am confused.
    Is it possible to solve this equation as i have done by using a quadratic equation or is it not?

    I need the intersection point between the two means, and also know that gaussian1=/gaussian2.

    Best regards
    Susanne
     \frac{1}{\sqrt{2 \pi} \, \sigma_1} e^{\frac{-(x - \mu_1)^2}{2\sigma_1^2}} = \frac{1}{\sqrt{2 \pi} \, \sigma_2} e^{\frac{-(x - \mu_2)^2}{2\sigma_2^2}}


    \Rightarrow e^{ \frac{ -(x - \mu_1)^2}{2\sigma_1^2} + \frac{(x - \mu_2)^2}{2\sigma_2^2} } = \frac{\sigma_1}{\sigma_2}


    \Rightarrow \frac{ -(x - \mu_1)^2}{2\sigma_1^2} + \frac{(x - \mu_2)^2}{2\sigma_2^2} = \ln \left( \frac{\sigma_1}{\sigma_2} \right)


    \Rightarrow -\sigma_2^2 (x - \mu_1)^2 + \sigma_1^2 (x - \mu_2)^2 = 2 \sigma_2^2 \sigma_1^2 \ln \left( \frac{\sigma_1}{\sigma_2} \right)


    It is simple but tedious to expand the left hand side, re-arrange and solve the quadratic for x. I'd suggest introducing some notation to streamline things. Use the discriminant to set conditions on the mean and variances such that you have the desired number of solutions.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Aug 2008
    Posts
    6
    Thanks a lot for the answer mrfantastic. So it is possible to solve this problem using the equations, and i do not have to solve it numerically.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Newbie
    Joined
    Aug 2008
    Posts
    6
    well to completely show how much i sucks at this i would much appreciate a review of the quadratic equation since the results are not correct.
    <br />
 -\frac{1}{2\sigma_{1}^{2}}(x^{2}-2\mu_{1}x+\mu_{1}^{2})+\frac{1}{2\sigma_{2}^{2}}(x  ^{2}-2\mu_{2}x+\mu_{2}^{2})<br />
    more rearranging
    <br />
 -\frac{1}{2\sigma_{1}^{2}}+\frac{1}{2\sigma_{2}^{2}  }x^{2}+\mu_{1}\frac{1}{2\sigma_{1}^{2}}-\mu_{2}\frac{1}{2\sigma_{2}^{2}}x-\frac{1}{2\sigma_{1}^{2}}\mu_{1}^{2}+\frac{1}{2\si  gma_{2}^{2}}\mu_{2}^{2}-ln\left(\frac{\sigma_{1}}{\sigma_{2}}\right)=0<br />
    when inserting
    <br />
\mu_{1}=-955 \textrm{  }\sigma_{1}^{2}=396<br />
    <br />
\mu_{2}=-1578 \textrm{  }\sigma_{2}^{2}=1117<br />
    I get y values -1878 and -1433 and this confuses me a bit.
    I would expect very small numbers denoting the probability and according to my plot it should be around 0.000036.
    The intersection point according to the plot should lie between -1530 and -1520.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Aug 2008
    Posts
    6

    Unhappy

    Hmm the intersection data was wrong, so here is the correct approximated solution.
    for two Gaussians with
    <br />
\mu_{1}=-955\textrm{   }\sigma_{1}^{2}=396<br />

    <br />
\mu_{2}=-1578\textrm{   }\sigma_{2}^{2}=1117<br />

    the approximated intersection point is at -1190 and the probability being
     3.0e^{-032}

    But i still haven't been able to poduce the correct answer using the quadratic equation.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Point of intersection
    Posted in the Advanced Algebra Forum
    Replies: 1
    Last Post: May 19th 2010, 08:57 AM
  2. Point of intersection
    Posted in the Calculus Forum
    Replies: 1
    Last Post: August 14th 2009, 10:59 AM
  3. point of intersection
    Posted in the Calculus Forum
    Replies: 6
    Last Post: February 22nd 2009, 04:57 PM
  4. point of intersection
    Posted in the Pre-Calculus Forum
    Replies: 3
    Last Post: December 8th 2008, 07:37 PM
  5. Point of intersection
    Posted in the Pre-Calculus Forum
    Replies: 3
    Last Post: April 10th 2008, 08:21 PM

Search Tags


/mathhelpforum @mathhelpforum