[Scipy-tickets] [SciPy] #1123: invgamma frozen rv object appears broken

SciPy Trac scipy-tickets@scipy....
Tue Feb 23 17:24:22 CST 2010


#1123: invgamma frozen rv object appears broken
---------------------------------------------------------------+------------
 Reporter:  arch_o_median                                      |       Owner:  somebody
     Type:  defect                                             |      Status:  new     
 Priority:  normal                                             |   Milestone:  0.8.0   
Component:  scipy.stats                                        |     Version:  0.7.0   
 Keywords:  invgamma inverse gamma pdf parameters shape scale  |  
---------------------------------------------------------------+------------
 I instantiated an invgamma object and called its .pdf method, but I am
 unable to generate pdf values...

 In [40]: MyInvGamma = scipy.stats.invgamma(shape=3,scale=3)
 In [41]: MyInvGamma.pdf(3)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /usr/lib/python2.6/dist-packages/scipy/stats/distributions.pyc in
 pdf(self, x)
     113         self.dist = dist
     114     def pdf(self,x):    #raises AttributeError in frozen discrete
 distribution
 --> 115         return self.dist.pdf(x,*self.args,**self.kwds)
     116     def cdf(self,x):
     117         return self.dist.cdf(x,*self.args,**self.kwds)

 /usr/lib/python2.6/dist-packages/scipy/stats/distributions.pyc in
 pdf(self, x, *args, **kwds)
     582         goodargs = argsreduce(cond, *((x,)+args+(scale,)))
     583         scale, goodargs = goodargs[-1], goodargs[:-1]
 --> 584         place(output,cond,self._pdf(*goodargs) / scale)
     585         if output.ndim == 0:
     586             return output[()]

 TypeError: _pdf() takes exactly 3 arguments (2 given)
 In [42]: MyInvGamma.pdf(3,2)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 TypeError: pdf() takes exactly 2 arguments (3 given)
 In [43]: MyInvGamma.pdf(3,loc=2)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

    Any insight would be much appreciated!

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


More information about the Scipy-tickets mailing list