The parameterization of SciPy's lognorm
implementation of the log-normal disribution is not the same as that of Excel's LOGNORM functions. Excel uses the mean and standard deviation of the underlying normal distribution. To convert those to the SciPy shape s
, location loc
and scale scale
, use:
s = standard_dev
loc = 0
scale = np.exp(mean)
LOGNORM.INV(p, mean, standard_dev)
computes the inverse of the CDF. The corresponding method of SciPy's lognorm
object is ppf
(the percent-point function; scroll down in the reference page to find the discussion of the percent point function).
So to compute the equivalent of LOGNORM.INV(p, mean, standard_dev)
, you can use
lognorm.ppf(p, standard_dev, loc=0, scale=np.exp(mean))
See Calculate Scipy LOGNORM.CDF() and get the same answer as MS Excel LOGNORM.DIST for a similar question.