Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we use the lognorm function in scipy? #113

Open
ruixue-li opened this issue Jan 24, 2018 · 2 comments
Open

Can we use the lognorm function in scipy? #113

ruixue-li opened this issue Jan 24, 2018 · 2 comments

Comments

@ruixue-li
Copy link

I'm just wondering do we need to compute the pdf of lognorm on our own or can we use scipy.stats.lognorm.pdf/cdf?

@Otamio
Copy link

Otamio commented Jan 24, 2018

Maybe it's too late.
I noticed that problem too when I was doing PS2. There may be two cons of computing the pdf using the original formula: (1) error prone; (2) may encounter problems when x=0. Therefore I simply used scipy.stats.lognorm.pdf/cdf. That works perfectly fine for me.

@rickecon
Copy link
Contributor

Yes. The lognorm function works great. You just have to make sure you have the right location and scale parameter. You can also calculate the mean E[X] and variance Var[X] analytically as functions of mu and sigma.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants