Message Boards Message Boards

0
|
8429 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Calculate the distribution of the sum of two distributions in W|A?

Posted 8 years ago

I would like to query wolfram alpha to provide the distribution for the sum of two distributions, namely: - g is normal with mean=6% and sd=1%, and - x is exponential with lambda = 1%

What is the query needed to be written. Apparently wolfram alpha interprets each distribution correctly but not the sum. I tried: "probability distribution function of g+x, if g is normal with mean=6% and sd=1% and x is exponential with lambda = 1%"

POSTED BY: George Popescu
2 Replies
Posted 8 years ago

Current versions of Mathematica enable an even more direct solution than Craig's, although possibly not as instructive

In[12]:= PDF[
  TransformedDistribution[
   x + y, {x \[Distributed] NormalDistribution[\[Mu], \[Sigma]], 
    y \[Distributed] ExponentialDistribution[\[Lambda]]}]][z]

Out[12]= 1/2 E^(
 1/2 \[Lambda] (-2 z + 
    2 \[Mu] + \[Lambda] \[Sigma]^2)) \[Lambda] Erfc[(-z + \[Mu] + \
\[Lambda] \[Sigma]^2)/(Sqrt[2] \[Sigma])]
POSTED BY: Mike Luntz

Hello I am not sure what the Alpha Query would be.

However, if you have access to Mathematica, I believe that this is how would do it--and how to think about it (assuming I understand your question correctly:

Derivative of the cumulative distribution (ignoring the the fundamental theorem of calculus for a minute)

pdf = D[Integrate[
PDF[NormalDistribution[m, sd], x]  + 
PDF[ExponentialDistribution[decay], x], {x, -Infinity, y}, 
Assumptions -> Element[y, Reals] && sd > 0 && decay > 0], y]

Which gives you an expected (remembering the fundamental theorem), but not very exciting unormalized result:

pdf = Simplify[pdf]

Remembering to normalize

norm = Integrate[pdf, {y, -Infinity, Infinity}, 
  Assumptions -> sd > 0 && decay > 0]

We recognize an additional fact about the above by looking at ever-helpful mathworld: http://mathworld.wolfram.com/Erfc.html

pdf = Simplify[ pdf/norm]
POSTED BY: W. Craig Carter
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract