[Scipy-tickets] [SciPy] #1536: BUG: floc doesn't work (in lognorm) ?

SciPy Trac scipy-tickets@scipy....
Tue Oct 11 03:34:35 CDT 2011


#1536: BUG: floc doesn't work (in lognorm) ?
-------------------------+--------------------------------------------------
 Reporter:  josefpktd    |       Owner:  somebody   
     Type:  defect       |      Status:  new        
 Priority:  normal       |   Milestone:  Unscheduled
Component:  scipy.stats  |     Version:  0.9.0      
 Keywords:               |  
-------------------------+--------------------------------------------------

Comment(by pbrod):

 The reason for this error is located in the _reduce_func method in
 rv_continous class. If you replace the original code

 {{{
 def _reduce_func(self, args, kwds):
         args = list(args)
         Nargs = len(args) - 2
         fixedn = []
         index = range(Nargs) + [-2, -1]
         names = ['f%d' % n for n in range(Nargs)] + ['floc', 'fscale']
 }}}

 with the following:


 {{{
     def _reduce_func(self, args, kwds):
         args = list(args)
         Nargs = len(args)
         fixedn = []
         index = range(Nargs)
         names = ['f%d' % n for n in range(Nargs - 2)] + ['floc', 'fscale']
         ....
 }}}

 you will get what you want:


 {{{
 true
 0.25 0.0 20.0
 estimated, floc=0, loc=0
 [  0.2501   0.      19.9176] [  0.2504   0.0293  19.8873]
 [  0.2547   0.      19.9934] [  0.233   -1.8031  21.851 ]
 [  0.2537   0.      20.0144] [  2.5385e-01   1.0739e-02   2.0003e+01]
 [  0.2533   0.      20.0162] [  2.5340e-01   1.0745e-02   2.0005e+01]
 [  0.2519   0.      20.0688] [  0.2522   0.0293  20.0385]
 [  0.2465   0.      19.8195] [  0.2469   0.0299  19.7887]
 [  0.2553   0.      19.9747] [  2.5545e-01   1.0734e-02   1.9964e+01]
 [  0.2469   0.      19.8664] [  0.2473   0.0302  19.8353]
 [  0.2468   0.      19.9698] [  0.2472   0.03    19.9389]
 [  0.2648   0.      19.9094] [  2.6497e-01   1.0871e-02   1.9898e+01]
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1536#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