MeanEstimate.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include <cstdio>
  3. #include <map>
  4. #include <vector>
  5. #include <functional>
  6. #define VARIATION_COEF 0.02
  7. class CMeanEstimate
  8. {
  9. public:
  10. static bool IsANumber(double x);
  11. static void RemoveNanValues(std::vector<double> *A);
  12. static void RemoveValues(std::vector<double> *A, double value);
  13. static void RemoveOutOfBoundsValues(std::vector<double> *A, double percent);//precent : Bounds are the means +/- percent of the mean
  14. static void FindMinMax(std::vector<double> *A, double &min, double &max);
  15. static void FindMinMaxWithinBoundsValues(std::vector<double> *A, double percent, double &min, double &max);
  16. static double GetVariance(std::vector<double> *A);
  17. static double GetStandardDeviation(std::vector<double> *A);
  18. static double GetMean(std::vector<double> *A);
  19. static double GetMeanEstimate(std::vector<double> *A, double similarityCoef);
  20. static double GetMeanEstimate(std::vector<double> *A);
  21. static double GetMeanEstimateFileOutput(std::vector<double> *A, double similarityCoef=VARIATION_COEF);
  22. static void PrintMeanEstimate(std::vector<double> *A, std::vector<double> *B);
  23. static void PrintMeanEstimate(std::vector<double> *A, std::vector<double> *B, double similarityCoef);
  24. protected:
  25. CMeanEstimate();
  26. virtual ~CMeanEstimate();
  27. };