[SciPy-User] scipy.stats beginner: help with fitting distribution
Mon Mar 18 15:37:28 CDT 2013
On Mon, Mar 18, 2013 at 3:57 PM, Arvind Thiagarajan <firstname.lastname@example.org> wrote:
> Thanks Josef. I played around a bit more and in the Rice case, it
> appears the estimation is accurate only if loc and scale are supplied
> --- the fit is unable to estimate all three together accurately. Also,
> the estimation seems only accurate for larger values of the shape
> parameter. Just mentioning this for anyone else who may see similar
maybe it should work if loc is fixed.
> On Mon, Mar 18, 2013 at 12:28 PM, <email@example.com> wrote:
>> On Mon, Mar 18, 2013 at 2:46 PM, Arvind Thiagarajan <firstname.lastname@example.org> wrote:
>>> Hi all,
>>> I'm a beginner with SciPy so this may be a basic question. I am trying
>>> to fit a Rice distribution to some data using scipy.stats.
>>> However, I first tried some test code which doesn't seem to give me a
>>> very good fit. I tried the following code:
>>>>>> b = [0.3,]
>>>>>> samples = rice.rvs(b, loc=0, scale=1, size=1000)
>>> (0.0012012190480231357, -0.0023216862043629813, 1.024758538166374)
>>> Though the loc and scale seem ok (close to 0 and 1 respectively), I
>>> was hoping the first return value would be closer to 0.3 since the
>>> shape parameter I supplied while generating random samples was 0.3 (in
>>> the call to rvs).
>>> I initially thought 1000 samples was perhaps too few, but get
>>> similarly poor results with 10,000 samples as well. Concluded that I
>>> must be doing something wrong, or that I'm misinterpreting the usage
>>> for the rvs() or fit() functions. Is the fit function supposed to try
>>> to approximately find the same shape parameter I passed in to rvs? Or
>>> should I be interpreting the fit result differently?
>>> Wondering if anyone has any ideas?
>> general answer:
>> For some distributions it helps to try out different starting values.
>> For some distributions, the maximum likelihood estimation does not
>> work (like pareto if we want to estimate also loc), either curvature
>> problems or likelihood can go to infinite.
>> I don't know anything about the rice distributions, and don't know how
>> difficult it is to estimate the parameters.
>>> Thanks a lot,
>>> SciPy-User mailing list
>> SciPy-User mailing list
> SciPy-User mailing list
More information about the SciPy-User