[Scipy-tickets] [SciPy] #1583: mstats.chisquare and stats.chisquare documentation is out of date

SciPy Trac scipy-tickets@scipy....
Thu Jan 12 13:46:23 CST 2012


#1583: mstats.chisquare and stats.chisquare documentation is out of date
-------------------------+--------------------------------------------------
 Reporter:  dloewenherz  |       Owner:  somebody    
     Type:  defect       |      Status:  needs_review
 Priority:  normal       |   Milestone:  Unscheduled 
Component:  scipy.stats  |     Version:  devel       
 Keywords:  chisquare    |  
-------------------------+--------------------------------------------------
Changes (by dloewenherz):

  * status:  new => needs_review


Comment:

 So in looking at the `chisquare` source (printed again here for
 convenience):

 {{{
 f_obs = asarray(f_obs)
 k = len(f_obs)
 if f_exp is None:
     f_exp = array([np.sum(f_obs,axis=0)/float(k)] * len(f_obs),float)
 f_exp = f_exp.astype(float)
 chisq = np.add.reduce((f_obs-f_exp)**2 / f_exp)
 return chisq, chisqprob(chisq, k-1-ddof)
 }}}

 It seems as though the degrees of freedom is improperly calculated. The
 above function only works for one dimensional data sets (e.g. where the
 number of observations is just the length of observations minus 1). I just
 submitted a pull request for this change.

 https://github.com/scipy/scipy/pull/132

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