diff --git a/SCsub b/SCsub index 87e3ac1..597ee6f 100644 --- a/SCsub +++ b/SCsub @@ -82,6 +82,7 @@ sources = [ "mlpp/transforms/transforms_old.cpp", "mlpp/stat/stat_old.cpp", "mlpp/lin_alg/lin_alg_old.cpp", + "mlpp/hypothesis_testing/hypothesis_testing_old.cpp", "test/mlpp_tests.cpp", ] diff --git a/mlpp/hypothesis_testing/hypothesis_testing_old.cpp b/mlpp/hypothesis_testing/hypothesis_testing_old.cpp new file mode 100644 index 0000000..cf32344 --- /dev/null +++ b/mlpp/hypothesis_testing/hypothesis_testing_old.cpp @@ -0,0 +1,20 @@ +// +// HypothesisTesting.cpp +// +// Created by Marc Melikyan on 3/10/21. +// + +#include "hypothesis_testing_old.h" + +std::tuple MLPPHypothesisTestingOld::chiSquareTest(std::vector observed, std::vector expected) { + //real_t df = observed.size() - 1; // These are our degrees of freedom + real_t sum = 0; + for (uint32_t i = 0; i < observed.size(); i++) { + sum += (observed[i] - expected[i]) * (observed[i] - expected[i]) / expected[i]; + } + + return std::tuple(); +} + +void MLPPHypothesisTestingOld::_bind_methods() { +} diff --git a/mlpp/hypothesis_testing/hypothesis_testing_old.h b/mlpp/hypothesis_testing/hypothesis_testing_old.h new file mode 100644 index 0000000..bfb730c --- /dev/null +++ b/mlpp/hypothesis_testing/hypothesis_testing_old.h @@ -0,0 +1,28 @@ + +#ifndef MLPP_HYPOTHESIS_TESTING_OLD_H +#define MLPP_HYPOTHESIS_TESTING_OLD_H + +// +// HypothesisTesting.hpp +// +// Created by Marc Melikyan on 3/10/21. +// + +#include "core/math/math_defs.h" + +#include "core/object/reference.h" + +#include +#include + +class MLPPHypothesisTestingOld : public Reference { + GDCLASS(MLPPHypothesisTestingOld, Reference); + +public: + std::tuple chiSquareTest(std::vector observed, std::vector expected); + +protected: + static void _bind_methods(); +}; + +#endif /* HypothesisTesting_hpp */