Parcourir la source

update kurtosis formula

Jérôme BUISINE il y a 3 ans
Parent
commit
cefb3468e9
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      main/extract_stats_images.cpp

+ 2 - 2
main/extract_stats_images.cpp

@@ -110,12 +110,12 @@ float getEstimator(std::string estimator, std::vector<float> values) {
 
         // Now calculate the sum of pow 2
         auto order2_func = [&mean, &size](float accumulator, const float& val) {
-            return accumulator + pow(val - pow(mean, 2), 2);
+            return accumulator + pow(val - mean, 2);
         };
 
         float order2 = std::accumulate(values.begin(), values.end(), 0.0, order2_func);
 
-        return size * (order4 / order2);
+        return size * (order4 / pow(order2, 2));
 
     } else if (estimator == "mode") {