[Scipy-tickets] [SciPy] #422: exponweib.stats

SciPy scipy-tickets@scipy....
Mon Jan 7 22:14:54 CST 2008

#422: exponweib.stats
 Reporter:  dhuard       |        Owner:  somebody
     Type:  defect       |       Status:  new     
 Priority:  normal       |    Milestone:  0.7     
Component:  scipy.stats  |      Version:          
 Severity:  normal       |   Resolution:          
 Keywords:               |  
Comment (by dhuard):

 It seems that every function that does not implement _stats suffers from a
 similar problem.
 One reason for the bug seems to be in the numpy vectorize function.
 Vectorize call _get_nargs which returns the number of arguments that a
 function takes. However, in stats.distributions.py we have
 {{{self.generic_moment = sgf(self._mom0_sc,otypes='d')}}}
 where sgf = vectorize and
 def _mom0_sc(self, m,*args):
         return scipy.integrate.quad(self._mom_integ0, self.a,
                                     self.b, args=(m,)+args)[0]
 The problem with *args is that vectorize believes that there is only two
 arguments (besides self).

 One solution to this problem is to correct the nin attribute of the
 vectorized function after it is created.
 Here for instance, we would do
 {{{self.generic_moment.nin = 3}}}
 and more generally
 {{{self.generic_moment.nin = self.numargs+1}}}

 This is fixed in revision #3797.

Ticket URL: <http://scipy.org/scipy/scipy/ticket/422#comment:2>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list