Changeset 532 for trunk/lib/statistics/tScore.cc
 Timestamp:
 Mar 2, 2006, 6:44:48 PM (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/lib/statistics/tScore.cc
r529 r532 25 25 statistics::Averager positive; 26 26 statistics::Averager negative; 27 dof_=target.size()2;28 27 for(size_t i=0; i<target.size(); i++){ 29 28 if (target.binary(i)) … … 33 32 } 34 33 double diff = positive.mean()  negative.mean(); 35 double s2=(positive.sum_xx_centered()+negative.sum_xx_centered())/ 36 (positive.n()+negative.n()2); 34 dof_=positive.n()+negative.n()2; 35 double s2=(positive.sum_xx_centered()+negative.sum_xx_centered())/dof_; 36 37 37 t_=diff/sqrt(s2*(1.0/positive.n()+1.0/negative.n())); 38 38 if (t_<0 && absolute_) … … 57 57 } 58 58 double diff = positive.mean()  negative.mean(); 59 double s2=(positive.sum_xx_centered()+negative.sum_xx_centered())/ 60 (positive.n()+negative.n()2); 61 t_=diff/sqrt(s2*(1.0/positive.sum_w()+1.0/negative.sum_w())); 59 dof_=positive.sum_w()*positive.sum_w()/positive.sum_ww() + 60 negative.sum_w()*negative.sum_w()/negative.sum_ww(); 61 double s2=(positive.sum_xx_centered()+negative.sum_xx_centered())/dof_; 62 t_=diff/sqrt(s2*(1.0/(positive.sum_w()*positive.sum_w()/positive.sum_ww())+ 63 1.0/(negative.sum_w()*negative.sum_w()/negative.sum_ww()))); 62 64 if (t_<0 && absolute_) 63 65 t_=t_; 64 66 65 if(positive.n()==0  negative.n()==0  66 positive.sum_w()==0  positive.sum_w()==0) 67 if(positive.sum_w()==0  negative.sum_w()==0) 67 68 t_=0; 68 dof_=target.size()2;69 70 69 return t_; 71 70 }
Note: See TracChangeset
for help on using the changeset viewer.