bundles / scipy 1.17.1 / scipy / stats / _continuous_distns / uniform_gen / fit
function
scipy.stats._continuous_distns:uniform_gen.fit
Signature
def fit ( self , data , * args , ** kwds ) Summary
Maximum likelihood estimate for the location and scale parameters.
Extended Summary
uniform.fit uses only the following parameters. Because exact formulas are used, the parameters related to optimization that are available in the fit method of other distributions are ignored here. The only positional argument accepted is data.
Parameters
data: array_likeData to use in calculating the maximum likelihood estimate.
floc: float, optionalHold the location parameter fixed to the specified value.
fscale: float, optionalHold the scale parameter fixed to the specified value.
Returns
loc, scale: floatMaximum likelihood estimates for the location and scale.
Notes
An error is raised if floc is given and any values in data are less than floc, or if fscale is given and fscale is less than data.max() - data.min(). An error is also raised if both floc and fscale are given.
Examples
import numpy as np from scipy.stats import uniform✓
x = np.array([2, 2.5, 3.1, 9.5, 13.0])
✓loc, scale = uniform.fit(x) loc scale✓
loc, scale = uniform.fit(x, floc=0) loc scale✓
loc, scale = uniform.fit(x, fscale=12) loc scale✓
Aliases
-
scipy.stats._continuous_distns.uniform_gen.fit