[SciPy-Dev] stats, distributions, design choices

Evgeni Burovski evgeny.burovskiy at gmail.com
Fri Jun 14 10:07:19 EDT 2013


Changing all the _argchecks sounds fishy indeed, but since all the pdf-type
methods call _argcheck anyway, the additional cost would not be large.
Moreover, extracting `loc` and `scale` and _argcheck-ing can be factored
out from individual methods to a special method of rv_distrubution. This
would require a bit of fiddling with  the arguments of private methods
(_pdf and its relatives), but the upshot is that for frozen all this would
only be done once, at the freezing time.
What would you say?

Zhenya


On Fri, Jun 14, 2013 at 1:44 AM, <josef.pktd at gmail.com> wrote:

> On Thu, Jun 13, 2013 at 7:46 PM, Evgeni Burovski
> <evgeny.burovskiy at gmail.com> wrote:
> >
> >>
> >> In general, it's just the pattern that we follow, why do we have nans
> >> and masked arrays?
> >
> >
> > That I understand --- I just like signalling NaNs much more than quite
> ones,
> > so was trying to sneak one in.
> >
> > Anyway, if it doesn't match the usage, it's over; thanks for the
> > clarification!
>
> raising an exception is too drastic as change in behavior/pattern in
> my opinion, but I'm thinking whether we could issue a special warning.
> A warning could be set by users to raise an exception.
>
> Checking the scale would be easy, that's in one central location.
> However, checking the shape parameter relies on the individual
> `_argcheck` and on the calls to them in each method. To change those,
> we would have to either change all _argchecks which I don't think is a
> good idea, or to change all methods.
> In the methods (at least most of them) it would not incur any
> additional cost to check if there are any invalid parameters, or it
> would not cost much, depending on where the check is done.
> (based on what I remember, I didn't check the current code.)
>
>
> I wouldn't be opposed to that, but Ralf is the expert on warnings.
>
> Josef
>
> >
> >
> > Zhenya
> >
> > _______________________________________________
> > SciPy-Dev mailing list
> > SciPy-Dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-dev
> >
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20130614/28f3072e/attachment.html>


More information about the SciPy-Dev mailing list