[SciPy-user] distribution.fit() methods

Travis E. Oliphant oliphant at ee.byu.edu
Fri May 21 14:40:13 CDT 2004

Jon Peirce wrote:
> Hi there,
> I'm trying to fit a weibull function to some data using Scipy. It looks 
> like I should be able to use exponweibull_gen.fit but I'm a bit puzzled 
> about the arguments. According to the code the arguments  (data, *args, 
> **kwds) are needed, where *args seems to contain the shape parameters 
> for the fit and **kwds contains the location and scale params.
> But if I'm fitting a function, surely I want to give xData and yData and 
> *not* shape arguments (or maybe a first guess at those). Does anyone 
> know how to use these methods?

These fit methods are a fairly thin wrapper around optimize.fmin.  The 
intended use is to take random variates you suspect as being weibull 
distributed and find the maximum likelihood estimates of the shape, 
location, and scale parameters.

Notice, it does not try to fit (x,y) coordinates to a weibull function.
To do that you should just use an optimization method and with a fit 
function that involves the exponweib.pdf function.

Please clarify what it is that you are trying to do.   Also, the 
XXXXX_gen classes are not intended for general use unless you know what 
you are doing.  What you want is exponweib.XXX --- this gives you a 
realization of the XXXXX_gen class.

-Travis O.

More information about the SciPy-user mailing list