I fought my way through the source code, to arrive at the following interpretation of the scipy lognormal routine.
$\frac{x-\text{loc}}{\text{scale}} \sim \text{Lognormal}(\sigma)$
where $\sigma$ is the "shape" parameter.
The equivalence between scipy parameters and R parameter is as follows:
loc - No equivalent, this gets subtracted from your data so that 0 becomes the infimum of the range of the data.
scale - $\exp{\mu}$, where $\mu$ is the mean of the log of the variate. (When fitting, typically you'd use the sample mean of the log of the data.)
shape - the standard deviation of the log of the variate.
I called lognorm.pdf(x, 0.55, 0, numpy.exp(4.29))
where the arguments are (x, shape, loc, scale) respectively, and generated the following values:
x pdf
10 0.000106
20 0.002275
30 0.006552
40 0.009979
50 0.114557
60 0.113479
70 0.103327
80 0.008941
90 0.007494
100 0.006155
which seem to match pretty well with your R curve.
Gamma function has three parametrizations:
- With a shape parameter k and a scale parameter θ.
- With a shape parameter α = k and an inverse scale parameter β = 1/θ, called a rate parameter.
- With a shape parameter k and a mean parameter μ = k/β.
In Excel, the second, "standradized", form is used. But it's possible to shift and/or scale the distribution using the loc and scale parameters. Specifically, gamma.pdf(x, alfa, loc, scale) is identically equivalent to gamma.pdf(y, alfa) / scale with y = (x - loc) / scale.
Hence to generate data in Excel just apply loc as above and then use Excel function as usual with parameters, returned from scipy.fit
Best Answer
From scipy docs: "If log x is normally distributed with mean mu and variance sigma**2, then x is log-normally distributed with shape parameter sigma and scale parameter exp(mu)."
The location parameter shifts the lognormal distribution along the x-axis so the lower bound wouldn't be zero (which is what the location parameter defaults to.)