0

I have some positively-skewed data that appear to be log-normal. Does anyone know of a good way to compute the standard deviation and the mean? Usually, I'd use numpy.mean(arr, axis=0) for general data, but because I believe I now also need to take the the log of the frequency as well to find the mean and standard deviation, I can't use that any more.

Any thought appreciated.

John M.
  • 2,642
  • 7
  • 26
  • 55
  • 1
    This might help... https://stackoverflow.com/questions/10000436/is-there-a-python-method-to-calculate-lognormal-mean-and-variance – Matt Hall Feb 06 '18 at 13:09
  • @kwinkunks Yes, I saw that. But the code in the accepted answer has the comment `given the mean (mu) and standard deviation (sigma), of the associated normal distribution`. My data isn't a normal distribution though. – John M. Feb 06 '18 at 13:13
  • 1
    See my answer here: https://stackoverflow.com/questions/15630647/fitting-lognormal-distribution-using-scipy-vs-matlab/15632937#15632937; in particular, the `lognfit` function in that code simply computes the mean and std. dev. of the log of the data. – Warren Weckesser Feb 06 '18 at 13:17

0 Answers0