|
"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
|