0

I am relatively new to the concept of Python Programming, infact I have a below par Basic Knowledge of Python coding. However I have a assignment to submit and hence I am asking for the help of Community Members here

so I need to Plot a CDF for a Lognormal Random Variable value with a median 10.0 and 20% dispersion. I can calculate the Mean and Standard Deviation for the above Values Manually using the Lognormal distribution sequence Formulas for Random Variables.

since my knowledge is Primitive I wasn't able to determine the code concept. Could Someone please help me on this issue?.

Update 1 :Going through the Forum I was able to determine the code which I found useful and this would be as follow

import math
from scipy import stats

# standard deviation of lognormal distribution
sigma = -19917.63
# mean of Lognormal distribution
mu = 22135.873
# hopefully, total is the value where you need the cdf
total = 37

frozen_lognorm = stats.lognorm(s=sigma, scale=math.exp(mu))
frozen_lognorm.cdf(total) # use whatever function and value you need here

I hope this code suffices or do I need to change anything else?

  • See also [How to plot cdf in matplotlib?](https://stackoverflow.com/questions/9378420/how-to-plot-cdf-in-matplotlib-in-python) and [How to plot empirical cdf](https://stackoverflow.com/questions/3209362/how-to-plot-empirical-cdf-in-matplotlib-in-python) – JohanC Sep 29 '21 at 15:45
  • @TrentonMcKinney Thanks for letting me know, I went through the Forum and found out the requirements . I have updated my question now – suzdeex8197 Sep 29 '21 at 18:09

0 Answers0