[SciPy-Dev] Working on the docstring for stats.distributions.rv_continuous.fit

David Goldsmith d.l.goldsmith at gmail.com
Wed Jun 16 11:49:06 EDT 2010


Skipper:

First, thanks for your help! :-)

On Wed, Jun 16, 2010 at 7:19 AM, Skipper Seabold <jsseabold at gmail.com>wrote:

> On Tue, Jun 15, 2010 at 8:38 PM, David Goldsmith
> <d.l.goldsmith at gmail.com> wrote:
> > Hi!  IMHO, the descriptions of the *args & **kwds parameters of the
> > Subject-referenced method are not very clear, so let me see if I
> understand
> > correctly:
> >
>
> I agree and was having a look at this last week.  Here's my take.  I
> would err on the side of verbose in these docs, as the stats docs seem
> to be a general source of confusion from comments I've received off
> list, though obviously Josef, Travis, and others would know the
> details better than I.
>
> > *args : float(s), optional
> >     If the distribution in question depends on n parameters, _excluding
> > location and scale_, then *args may contain 0 to n floats, which are
> > starting estimates for the corresponding parameters.  No default
> value(s).
> >
>
> I would add a note that n can be found in the numargs attribute of the
> distribution.
>
> > **kwds _may_ contain the following:
> >
> > loc : float, optional
> >     Starting estimate for the location parameter, no default.
> >
> > scale : float, optional
> >     Starting estimate for the scale parameter, no default.
>
> If the extra args *and* loc *and* scale are not specified, then the
> default starting estimates for loc, scale, and args are taken from the
> distribution's _fitstart(data) method.  I think it would make more
> sense to take the defaults for ones that are not provided by the user
> only, but this is not how the code reads at the moment as far as I can
> tell.
>

So I can ignore this comment, correct?  If not, we once again have the
issue: document desired/intended behavior, if that differs from extant
behavior...

>
> > floc : bool, optional
> >     Hold the location parameter constant; default: False.
> >
>
> floc : float, optional
>    Hold the location parameter constant at the given value.  Default:
> Fit this parameter using the data.
>

So does this override a value provided by loc?  Is one supposed to not
specify both loc and floc?  What happens if one does? Is an exception
raised?

>
> > fscale : bool, optional
> >     Hold the scale parameter constant; default: False
> >
>
> See above.
>

Ditto.

>
> > fi : bool, optional
> >     Hold the i-th scale parameter constant; there may be up to len(args)
> of
> > these; default: False
> >
>
> I would keep it as something like
>
> f1...fn : float, optional
>   Hold shape parameter fi constant at the given value, where i may be
> 1 to numargs of the distribution.
>

Ditto.

DG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20100616/f9fa5268/attachment.html>


More information about the SciPy-Dev mailing list