Skip to content
Permalink
Browse files
Merge pull request #12 from rodo/master
Remove non needed clause in ranks_of/5
  • Loading branch information
joewilliams committed Nov 4, 2013
2 parents 3cb96e4 + 69a9cf0 commit b9feed8400db6ff923a67f77b476e22fd3a193fd
Showing 2 changed files with 5 additions and 2 deletions.
@@ -278,8 +278,6 @@ ranks_of(Values) when is_list(Values) ->
end, [], Values),
lists:reverse(L).

ranks_of([E|Es],Acc, N, E, S) ->
ranks_of(Es, Acc, N+1, E, S);
ranks_of([E|Es], Acc, N, P, S) ->
ranks_of(Es,[{P,(S+N-1)/2}|Acc], N+1, E, N);
ranks_of([], Acc, N, P, S) ->
@@ -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 b9feed8

Please sign in to comment.