File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -83,10 +83,9 @@ T pchisq(const T &stat, const unsigned int &k) {
8383 * @return A boolean which indicates that x is normally distributed or not.
8484 *
8585 */
86- template <typename T = long double >
87- bool jb_test (const std::vector<T> &x) {
86+ bool jb_test (const std::vector<long double > &x) {
8887 const unsigned long n = x.size ();
89- auto m1 = std::accumulate (x.begin (), x.end (), (T) 0.0 ) / n;
88+ auto m1 = std::accumulate (x.begin (), x.end (), 0.0 ) / n;
9089 auto m2 = 0 ;
9190 auto m3 = 0 ;
9291 auto m4 = 0 ;
@@ -103,11 +102,7 @@ bool jb_test(const std::vector<T> &x) {
103102 auto K = m4 / std::pow (m2, 2 );
104103 auto stat = n * (S / 6 + std::pow (K - 3 , 2 ) / 24 );
105104 auto p_val = 1 - pchisq (stat, 2 );
106- if (p_val > 0.05 ) {
107- return true ;
108- } else {
109- return false ;
110- }
105+ return p_val > 0.05 ;
111106}
112107
113108#endif // STATISTICS_H
You can’t perform that action at this time.
0 commit comments