Skip to content
Permalink
Browse files
Add a new test on Pearson correlation
  • Loading branch information
rodo committed Nov 1, 2013
1 parent bd20bd5 commit 69a9cf0097b802caae34db16681773482a8d61d8
Showing 1 changed file with 5 additions and 0 deletions.
@@ -173,6 +173,11 @@ get_pearson_correlation_test() ->
?assertEqual(1.0, bear:get_pearson_correlation(lists:seq(0,10), lists:seq(5,15))),
?assertEqual(1.0, bear:get_pearson_correlation(lists:seq(40,60,2), lists:seq(10,20))).

get_pearson_correlation_nullresult_test() ->
%% The two series do not correlate
A = [-1,-0.5,0,0.5,1],
B = [1,0.25,0,0.25,1],
?assertEqual(0.0, bear:get_pearson_correlation(A, B)).

round_bin_test() ->
?assertEqual(10, bear:round_bin(10)),

0 comments on commit 69a9cf0

Please sign in to comment.