How to correctly use scipy.stats.lognorm?

153 views Asked by At

I'm trying to learn Python through the lecture series at Quantopian and am having trouble understanding how to use scipy.stats.lognorm and the documentation.

This are the excerpts:

pdf(x, s, loc=0, scale=1)
ppf(q, s, loc=0, scale=1)

I've included the code found in the documentation: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.lognorm.html

I would like to know how s = 0.954 is derived and what q stands for, and what does it mean when you change loc and scale? I know it shifts the functions but I don't really understand what it means, if somebody could explain this in a 'for dummies' way that would be great.

s = 0.954
mean, var, skew, kurt = lognorm.stats(s, moments='mvsk')

x = np.linspace(lognorm.ppf(0.01, s), lognorm.ppf(0.99, s), 100)
ax.plot(x, lognorm.pdf(x, s), 'r-', lw=5, alpha=0.6, label='lognorm pdf')
0

There are 0 answers