[SciPy-dev] Problem with F distribution, or with me? - ticket 422 might apply for discrete distributions
Thu Aug 28 15:35:26 CDT 2008
I just saw the report by Alan McIntyre that this fails
Looking briefly at the current trunk source, I think now that the
problem with the generic cdf for defined distributions such as zipf is
3383 self._cdfvec = sgf(self._cdfsingle,otypes='d')
3469 def _cdfsingle(self, k, *args):
If the explanation in ticket 422 applies more generally, then all
calls to vectorize, i.e. to sgf, would need to be checked in
I'm sorry if I'm barking up the wrong tree, I am just looking at the
pattern without knowing the internals.
On 8/26/08, email@example.com <firstname.lastname@example.org> wrote:
> On Tue, Aug 26, 2008 at 8:18 PM, <email@example.com> wrote:
>> Can somebody run:
>> I get
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in ?
>> ackages\scipy\stats\distributions.py", line 3549, in cdf
>> ackages\scipy\stats\distributions.py", line 3458, in _cdf
>> return self._cdfvec(k,*args)
>> File "C:\Programs\Python24\Lib\site-packages\numpy\lib\function_base.py",
>> 1092, in __call__
>> raise ValueError, "mismatch between python function inputs"\
>> ValueError: mismatch between python function inputs and received arguments
>> but this might be, because I am running either an older version of
>> scipy or from my own faulty (?) build from subversion.
>> If the current version still has this error, then I think it is
>> related to the generic calculation of the cdf,
>> similar to ticket 422, changeset 3797 for the moment calculation.
>> In my tests I get many value errors, but again I don't know whether it
>> is my version/setup, whether the parameters are not ruled out but
>> don't make sense, or whether there is actually a bug somewhere.
> in changeset 3797 this was added to the continuous random variable:
> 315 self.generic_moment.nin = self.numargs+1 # Because of the
> *args argument
> 316 # of _mom0_sc, vectorize cannot count the number of
> arguments correctly.
> in current trunk these are lines 318 and 319
> I don't understand the details of numpy and vectorize, but I think
> that the same problem with the number
> of arguments also applies to the generic calculation for the discrete
> distribution, i.e. lines
> 3401 self._ppf = new.instancemethod(sgf(_drv_ppf,otypes='d'),
> 3402 self, rv_discrete)
> 3403 self._pmf = new.instancemethod(sgf(_drv_pmf,otypes='d'),
> 3404 self, rv_discrete)
> 3405 self._cdf = new.instancemethod(sgf(_drv_cdf,otypes='d'),
> 3406 self, rv_discrete)
> since all _drv_??? methods also use the *args argument and the
> exception message I get looks the same as in ticket 422.
More information about the Scipy-dev