Scipy: What's The Difference Between Fit Using Loc=0, Floc=0?
As I'm fitting a Weibull distribution, and also find in other questions as Fitting distribution with fixed parameters in SciPy There is a difference between fit using floc=0, and l
Solution 1:
The short answer is: floc
(and fscale
for that matter) are used to specify that the location parameter (and scale parameter respectively) are to be kept fixed at the specified value. loc
and scale
merely give starting values for the fit.
sp.stats.weibull_min
inherits the fit
method from scipy.stat.rv_continuous
. The documentation of scipy.stats.rv_continuous.fit
specifies the fact, that floc
and fscale
keep said parameters fixed. loc
, scale
and other keyword arguments that are recognized by derived distributions are simply used as starting values.
So if you want to fit keeping the location fixed, you should use floc=0
if you only want to provide a starting parameter, you should use loc=0
.
Post a Comment for "Scipy: What's The Difference Between Fit Using Loc=0, Floc=0?"