]> git.treefish.org Git - phys/latlib.git/commitdiff
wrong variances\!
authorAlex Schmidt <alex@treefish.org>
Tue, 29 May 2012 10:09:56 +0000 (12:09 +0200)
committerAlex Schmidt <alex@treefish.org>
Tue, 29 May 2012 10:09:56 +0000 (12:09 +0200)
obs.hpp

diff --git a/obs.hpp b/obs.hpp
index 99d97fa10aaedea8f8f3689fd33c3ba832326a36..dd9b23da061c96719142519df7566def487baacd 100644 (file)
--- a/obs.hpp
+++ b/obs.hpp
@@ -74,7 +74,7 @@ void obs<obstype>::mean(const string& compid, vector< vector<double> > *meas, co
   
   for(vector< vector<double> >::iterator measIt = meas->begin(); measIt != meas->end(); ++measIt)
     computations[compid].err += pow( (*measIt)[ival] - computations[compid].val, 2 );
-  computations[compid].err /= nmeas*(nmeas-1);
+  computations[compid].err /= nmeas-1;
   computations[compid].err = sqrt( computations[compid].err );  
 }
 
@@ -92,8 +92,8 @@ void obs<obstype>::mean(const string& compid, vector< vector<int> > *meas, const
   
   for(vector< vector<int> >::iterator measIt = meas->begin(); measIt != meas->end(); ++measIt)
     computations[compid].err += pow( (*measIt)[ival] - computations[compid].val, 2 );
-  computations[compid].err /= nmeas*(nmeas-1);
-  computations[compid].err = sqrt( computations[compid].err );  
+  computations[compid].err /= nmeas-1;
+  computations[compid].err = sqrt( computations[compid].err );
 }                               
     
 template <typename obstype>