Scipy.stats.expon.fit () without location parameter

I use scipy.stats.expon.fit(data)to match the exponential distribution over my data. This seems to return two values, where I would expect one. The online documentation doesn’t seem to say what it returns fit(), but looking at the source, I assume this is a location and scale parameter. Can you set the location parameter to 0when fitting?

+4
source share
1 answer

In a call, expon.fituse floc=0:

In [5]: data = expon.rvs(0, 1.5, 1000)

In [6]: loc, scale = expon.fit(data, floc=0)

In [7]: scale
Out[7]: 1.4878030368336586

In [8]: loc
Out[8]: 0
+6
source

All Articles