[SciPy-User] scipy.stats.truncnorm behaviour

Joe mojoeschmoe@gmail....
Wed Apr 3 05:54:29 CDT 2013


 <josef.pktd <at> gmail.com> writes:

> 
> On Tue, Apr 2, 2013 at 12:39 PM, Pauli Virtanen <pav <at> iki.fi> wrote:
> > 02.04.2013 19:36, Joe Mellor kirjoitti:
> >> I have been using both scipy.stats.norm and scipy.stats.truncnorm and
> >> have found some (to me) unexpected differences in their behaviour.
> >> The differences are in how each handles the size parameter given to the
> >> rvs method.
> > [clip]
> >
> > This seems related?
> >
> > https://github.com/scipy/scipy/pull/463
> 
> I think that fixed this case (when the problem is in _ppf)
> 
> It looks like a case of http://projects.scipy.org/scipy/ticket/793
> problems with vectorized parameters when bounds depend on the parameters
> 
> Josef
> 
> > --
> > Pauli Virtanen
> >
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-User <at> scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-user
> 

Apologises for my ignorance, but I'm confused how 463 fixes a problem with _ppf? 
As far as I could tell the diff of the fix didn't touch _ppf, only functions not 
on the code path for the problem I raised?

793 appears to be about having array value arguments to methods like ppf and 
moment. I think truncnorm may also suffer from this bug, but is it not different 
from the size parameter problem? 

My understanding is that rvs takes some distribution parameters a,b,c which can 
be arrays compatible with say shape (x,) or (x,y). This should produce a return 
array of shape (x,) or (x,y) of variate. However, the size parameter can be 
specified potentially with a larger shape (z,x) or (z,x,y), which should return 
z different samples of the (x,) or (x,y) parameterised variates. 

Again apologises if I have completely misunderstood. 



More information about the SciPy-User mailing list