Let $X$ be a random variable that is of a mixture distribution of two lognormals (with the same sigma), so $X \approx p\cdot \mathcal L (\mu_1, \sigma) + (1-p)\cdot \mathcal L (\mu_2,\sigma)$.
Now set $Y=X_1 + X_2$, so $Y$ is a sum of two samples from this mixture.
First I generate some data according to this distribution:
dMix[p_, m1_, m2_, s_] :=
MixtureDistribution[{p, 1 - p}, {LogNormalDistribution[m1, s],
LogNormalDistribution[m2, s]}];
dat = Plus @@ RandomVariate[dMix[0.75, 0.5, -1.5, 0.2], {2,100}];
this is the pdf of my distribution, using TransformedDistribution
dMixSum =
TransformedDistribution[x1 + x2,
Thread[Distributed[{x1, x2},
MixtureDistribution[{p, 1 - p}, {LogNormalDistribution[m1, s],
LogNormalDistribution[m2, s]}]]]];
pdf[z_] = PDF[dMixSum, z];
pDist = ProbabilityDistribution[pdf[z], {z, -Infinity, Infinity},
Assumptions -> DistributionParameterAssumptions[dMixSum]]
Now FindDistributionParameters
should do the job (but it doesn't)
FindDistributionParameters[dat, pDist, {{m1, 1}, {m2, -1}, {s,
1}, {p, .5}}]
I think this is because the sum of two lognormals is not lognormally distributed (in a closed form), it is only approximately lognormal. Can I tell mathematica somehow to take this into account or is there another way to solve this?