[SciPy-User] How to fit parameters of beta distribution?

Christoph Deil deil.christoph at googlemail.com
Fri Jun 24 09:25:44 EDT 2011


On Jun 24, 2011, at 3:09 PM, John Reid wrote:

>>> I'm assuming fit() does a ML estimate of the parameters which I think is
>>> fine to do for a beta distribution and one data point.
>> 
>> You need at least as many observations as parameters, and without
>> enough observations the estimate will be very noisy. With fewer
>> observations than parameters, you cannot identify the parameters.
> 
> I'm not quite sure what you mean by "identify". It is a ML estimate 
> isn't it? That seems legitimate here but it wasn't really my original 
> question. I was just using [.5] as an example.
> 
> Thanks,
> John.


Technically you can compute the ML estimate of both parameters of a two-parameter distribution from one datapoint:

In [2]: scipy.stats.norm.fit([0])
Out[2]: (4.2006250261886009e-22, 2.0669568930051829e-21)

In [7]: scipy.stats.norm.fit([1])
Out[7]: (1.0, 5.4210108624275222e-20)

But in this case the width estimate of 0 is not meaningful, as you will get ML estimated width 0 for any true width because you don't have enough data to estimate the width.

You need at least two data points to get real estimates for two parameters:

In [6]: scipy.stats.norm.fit([0,1])
Out[6]: (0.5, 0.5)


More information about the SciPy-User mailing list