May-19-2018, 07:49 PM
Hi!
I have some x- and y- data, and i need to get the best fitting lognormal function, to obtain the mu and sigma of it.
Plottet, the data looks like this:
![[Image: Gm1Sv85]](https://imgur.com/Gm1Sv85)
I am quite struggeling with the stats.lognorm.fit() function. My code looks like this:
Any help is appreciated, thanks!
I have some x- and y- data, and i need to get the best fitting lognormal function, to obtain the mu and sigma of it.
Plottet, the data looks like this:
I am quite struggeling with the stats.lognorm.fit() function. My code looks like this:
from scipy import stats s, loc, scale = stats.lognorm.fit(x0, floc=0) #x0 is rawdata x-axis estimated_mu = np.log(scale) estimated_sigma = s print estimated_mu print estimated_sigma estimated mu = 1.4968829026551267 estimated sigma = 0.8699922377581952Unfortunately the calculated mu and sigma have nothing in common with my data.
Any help is appreciated, thanks!