<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.es/matlabcentral/newsreader/view_thread/241701</link>
    <title>MATLAB Central Newsreader - Approximation sum of 2 lognormal RVs</title>
    <description>Feed for thread: Approximation sum of 2 lognormal RVs</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2013 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.es/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 29 Dec 2008 23:41:02 +0000</pubDate>
      <title>Approximation sum of 2 lognormal RVs</title>
      <link>http://www.mathworks.es/matlabcentral/newsreader/view_thread/241701#619214</link>
      <author>Pete sherer</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I am looking for a function that can approximate parameters (mean and sigma) for the sum of 2 lognormal distributions. I know the mean and sigma of log(X) and log(Y).  The question is how to estimate the mean and sigma of (Z) and its distribution if not lognormal (assuming Z = X + Y).&lt;br&gt;
&lt;br&gt;
Has anyone seen work related to this question?&lt;br&gt;
Thanks&lt;br&gt;
Pete</description>
    </item>
    <item>
      <pubDate>Tue, 30 Dec 2008 00:34:02 +0000</pubDate>
      <title>Re: Approximation sum of 2 lognormal RVs</title>
      <link>http://www.mathworks.es/matlabcentral/newsreader/view_thread/241701#619217</link>
      <author>Roger Stafford</author>
      <description>"Pete sherer" &amp;lt;tsh@abg.com&amp;gt; wrote in message &amp;lt;gjbn6e$d62$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I am looking for a function that can approximate parameters (mean and sigma) for the sum of 2 lognormal distributions. I know the mean and sigma of log(X) and log(Y).  The question is how to estimate the mean and sigma of (Z) and its distribution if not lognormal (assuming Z = X + Y).&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Are you assuming X and Y are independent random variables?  If so, the Wikipedia website at&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Log-normal_distribution"&gt;http://en.wikipedia.org/wiki/Log-normal_distribution&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
has all the information you need to answer your question.  Just add the two expressions for the means, E(X) and E(Y), given there.  The standard deviation comes from&lt;br&gt;
&lt;br&gt;
&amp;nbsp;sigma^2 = E((Z-E(Z))^2) = &lt;br&gt;
&amp;nbsp;E((X-E(X))^2 + E((Y-E(Y))^2) = var(X) + var(Y)&lt;br&gt;
&lt;br&gt;
and these are also given in the website.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;(I assume that by your remark "and its distribution if not lognormal" you meant that Z would not be lognormal.)&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
    <item>
      <pubDate>Tue, 30 Dec 2008 01:03:01 +0000</pubDate>
      <title>Re: Approximation sum of 2 lognormal RVs</title>
      <link>http://www.mathworks.es/matlabcentral/newsreader/view_thread/241701#619219</link>
      <author>John D'Errico</author>
      <description>"Pete sherer" &amp;lt;tsh@abg.com&amp;gt; wrote in message &amp;lt;gjbn6e$d62$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I am looking for a function that can approximate parameters (mean and sigma) for the sum of 2 lognormal distributions. I know the mean and sigma of log(X) and log(Y).  The question is how to estimate the mean and sigma of (Z) and its distribution if not lognormal (assuming Z = X + Y).&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Has anyone seen work related to this question?&lt;br&gt;
&lt;br&gt;
We wrote a couple of papers on the topic some years&lt;br&gt;
ago.&lt;br&gt;
&lt;br&gt;
D'Errico &amp; Zaino, "Statistical Tolerancing Using a Modification&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;of Taguchi's Method", Technometrics, Vol 30, no. 4&lt;br&gt;
&lt;br&gt;
Here is a simple way to estimate the mean of the sum&lt;br&gt;
of the two random variables.&lt;br&gt;
&lt;br&gt;
% Start with three points on a Normal distribution.&lt;br&gt;
% Compute the corresponding percentiles for the&lt;br&gt;
% normal.&lt;br&gt;
P = normcdf([-sqrt(3) 0 sqrt(3)])&lt;br&gt;
P =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.041632          0.5      0.95837&lt;br&gt;
&lt;br&gt;
% invert them through the lognormal. This acts&lt;br&gt;
% as an effective transformation of variables.&lt;br&gt;
X = logninv(P)&lt;br&gt;
X =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.17692            1       5.6522&lt;br&gt;
&lt;br&gt;
[X1,X2] = meshgrid(X);&lt;br&gt;
&lt;br&gt;
% Compute an array of weights for the 9 points.&lt;br&gt;
W = [1 4 1]/6;&lt;br&gt;
W = W'*W&lt;br&gt;
W =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.027778      0.11111     0.027778&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.11111      0.44444      0.11111&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.027778      0.11111     0.027778&lt;br&gt;
&lt;br&gt;
% and compute the weighted mean&lt;br&gt;
Y = X1 + X2;&lt;br&gt;
Ybar = sum(Y(:).*W(:))&lt;br&gt;
% This will be a good estimate of the mean of&lt;br&gt;
% the sum of the two lognormal deviates, and&lt;br&gt;
% it took very little computation to generate.&lt;br&gt;
Ybar =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.2764&lt;br&gt;
&lt;br&gt;
% We can also compute a variance estimate.&lt;br&gt;
Yvar = sum(((Y(:) - Ybar).^2).*W(:))&lt;br&gt;
&lt;br&gt;
Yvar =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6.6257&lt;br&gt;
&lt;br&gt;
% Compare this to a Monte Carlo simulation.&lt;br&gt;
x1 = lognrnd(0,1,1000000,1);&lt;br&gt;
x2 = lognrnd(0,1,1000000,1);&lt;br&gt;
mean(x1+x2)&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.2965&lt;br&gt;
&lt;br&gt;
var(x1+x2)&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9.3206&lt;br&gt;
&lt;br&gt;
As it turns out, the mean estimate was quite good,&lt;br&gt;
but the variance estimate was not so good. This is&lt;br&gt;
because the method used was an implicit numerical&lt;br&gt;
integration. The mean is a lower order problem than&lt;br&gt;
computing the variance. I'll redo the analysis for a&lt;br&gt;
higher order method. (gaussquadrule is from my&lt;br&gt;
sympoly toolbox.)&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.mathworks.com/matlabcentral/fileexchange/9577"&gt;http://www.mathworks.com/matlabcentral/fileexchange/9577&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
[nodes,weights] = gaussquadrule(7,'hermite');&lt;br&gt;
nodes = nodes*sqrt(2);&lt;br&gt;
weights = weights/sum(weights);&lt;br&gt;
&lt;br&gt;
P = normcdf(nodes);&lt;br&gt;
X = logninv(P);&lt;br&gt;
[X1,X2] = meshgrid(X);&lt;br&gt;
Y = X1+X2;&lt;br&gt;
W = weights'*weights;&lt;br&gt;
&lt;br&gt;
Ybar = sum(Y(:).*W(:))&lt;br&gt;
Ybar =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3.2974&lt;br&gt;
&lt;br&gt;
Yvar = sum(((Y(:) - Ybar).^2).*W(:))&lt;br&gt;
Yvar =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9.3366&lt;br&gt;
&lt;br&gt;
As you can see, the mean and variance are now&lt;br&gt;
quite accurate as compared to the simulation.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Tue, 30 Dec 2008 03:11:02 +0000</pubDate>
      <title>Re: Approximation sum of 2 lognormal RVs</title>
      <link>http://www.mathworks.es/matlabcentral/newsreader/view_thread/241701#619229</link>
      <author>Pete sherer</author>
      <description>Hi John and Roger,&lt;br&gt;
&lt;br&gt;
Thank you so much for your help!!  They are exactly what I am looking for.&lt;br&gt;
&lt;br&gt;
Best and wish you guys a happy holidays.&lt;br&gt;
Pete</description>
    </item>
  </channel>
</rss>
