[Scipy-tickets] [SciPy] #1530: Bugs in fit when moments are inf (cauchy, t(1)), scipy 0.9.0

SciPy Trac scipy-tickets@scipy....
Sat Oct 8 10:06:12 CDT 2011

#1530: Bugs in fit when moments are inf (cauchy, t(1)), scipy 0.9.0
 Reporter:  gtg944q           |       Owner:  somebody   
     Type:  defect            |      Status:  new        
 Priority:  normal            |   Milestone:  Unscheduled
Component:  scipy.stats       |     Version:  0.9.0      
 Keywords:  cauchy fit stats  |  

Comment(by josefpktd):

 one possible solution:


 def fit_loc_scale(self, data, *args):

 check for finite mu mu2, e.g.

 if (not np.isfinite(mu)) or (not np.isfinite(mu2)):
     return 0., 1.

 I don't remember if mu or mu2 could be None at this stage, in cases when
 the moment don't exist. (In general, we have three cases for moments,
 finite, infinite, and don't exist. The last is if the integral for the
 expectation is not well defined.)

 '''Not a good solution''':

 this would solve the problem with starting values for fit, but
 fit_loc_scale would return incorrect values if we want it on it's own.

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

More information about the Scipy-tickets mailing list