Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Approximation sum of 2 lognormal RVs

Subject: Approximation sum of 2 lognormal RVs

From: Pete sherer

Date: 29 Dec, 2008 23:41:02

Message: 1 of 4

Hi,

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).

Has anyone seen work related to this question?
Thanks
Pete

Subject: Approximation sum of 2 lognormal RVs

From: Roger Stafford

Date: 30 Dec, 2008 00:34:02

Message: 2 of 4

"Pete sherer" <tsh@abg.com> wrote in message <gjbn6e$d62$1@fred.mathworks.com>...
> 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).

  Are you assuming X and Y are independent random variables? If so, the Wikipedia website at

 http://en.wikipedia.org/wiki/Log-normal_distribution

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

 sigma^2 = E((Z-E(Z))^2) =
 E((X-E(X))^2 + E((Y-E(Y))^2) = var(X) + var(Y)

and these are also given in the website.

  (I assume that by your remark "and its distribution if not lognormal" you meant that Z would not be lognormal.)

Roger Stafford

Subject: Approximation sum of 2 lognormal RVs

From: John D'Errico

Date: 30 Dec, 2008 01:03:01

Message: 3 of 4

"Pete sherer" <tsh@abg.com> wrote in message <gjbn6e$d62$1@fred.mathworks.com>...
> Hi,
>
> 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).
>
> Has anyone seen work related to this question?

We wrote a couple of papers on the topic some years
ago.

D'Errico & Zaino, "Statistical Tolerancing Using a Modification
   of Taguchi's Method", Technometrics, Vol 30, no. 4

Here is a simple way to estimate the mean of the sum
of the two random variables.

% Start with three points on a Normal distribution.
% Compute the corresponding percentiles for the
% normal.
P = normcdf([-sqrt(3) 0 sqrt(3)])
P =
     0.041632 0.5 0.95837

% invert them through the lognormal. This acts
% as an effective transformation of variables.
X = logninv(P)
X =
      0.17692 1 5.6522

[X1,X2] = meshgrid(X);

% Compute an array of weights for the 9 points.
W = [1 4 1]/6;
W = W'*W
W =
     0.027778 0.11111 0.027778
      0.11111 0.44444 0.11111
     0.027778 0.11111 0.027778

% and compute the weighted mean
Y = X1 + X2;
Ybar = sum(Y(:).*W(:))
% This will be a good estimate of the mean of
% the sum of the two lognormal deviates, and
% it took very little computation to generate.
Ybar =
       3.2764

% We can also compute a variance estimate.
Yvar = sum(((Y(:) - Ybar).^2).*W(:))

Yvar =
       6.6257

% Compare this to a Monte Carlo simulation.
x1 = lognrnd(0,1,1000000,1);
x2 = lognrnd(0,1,1000000,1);
mean(x1+x2)
ans =
       3.2965

var(x1+x2)
ans =
       9.3206

As it turns out, the mean estimate was quite good,
but the variance estimate was not so good. This is
because the method used was an implicit numerical
integration. The mean is a lower order problem than
computing the variance. I'll redo the analysis for a
higher order method. (gaussquadrule is from my
sympoly toolbox.)

http://www.mathworks.com/matlabcentral/fileexchange/9577

[nodes,weights] = gaussquadrule(7,'hermite');
nodes = nodes*sqrt(2);
weights = weights/sum(weights);

P = normcdf(nodes);
X = logninv(P);
[X1,X2] = meshgrid(X);
Y = X1+X2;
W = weights'*weights;

Ybar = sum(Y(:).*W(:))
Ybar =
       3.2974

Yvar = sum(((Y(:) - Ybar).^2).*W(:))
Yvar =
       9.3366

As you can see, the mean and variance are now
quite accurate as compared to the simulation.

John

Subject: Approximation sum of 2 lognormal RVs

From: Pete sherer

Date: 30 Dec, 2008 03:11:02

Message: 4 of 4

Hi John and Roger,

Thank you so much for your help!! They are exactly what I am looking for.

Best and wish you guys a happy holidays.
Pete

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us