Skip to content

Commit

Permalink
Scaling of input in test was done wrong
Browse files Browse the repository at this point in the history
Fixes #197
  • Loading branch information
Shimuuar committed Jan 15, 2025
1 parent 2ef0ae2 commit 6f89602
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/Tests/Correlation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ testSpearmanNonlinear sample0
, not (isNaN c3)
, not (isNaN c4)
]
==> ( counterexample (show sample0)
$ counterexample (show sample1)
$ counterexample (show sample2)
$ counterexample (show sample3)
$ counterexample (show sample4)
==> ( counterexample ("S0 = " ++ show sample0)
$ counterexample ("S1 = " ++ show sample1)
$ counterexample ("S2 = " ++ show sample2)
$ counterexample ("S3 = " ++ show sample3)
$ counterexample ("S4 = " ++ show sample4)
$ counterexample (show (c1,c2,c3,c4))
$ and [ c1 == c2
, c1 == c3
Expand All @@ -117,8 +117,8 @@ testSpearmanNonlinear sample0
-- We need to stretch sample into [-10 .. 10] range to avoid
-- problems with under/overflows etc.
stretch xs
| a == b = xs
| otherwise = [ (x - a - 10) * 20 / (a - b) | x <- xs ]
| a == b = xs
| otherwise = [ ((x - a)/(b - a) - 0.5) * 20 | x <- xs ]
where
a = minimum xs
b = maximum xs
Expand Down

0 comments on commit 6f89602

Please sign in to comment.