Commits

Aleksey Khudyakov committed a7fc6e1

Fix test for quantile. Select p more efficiently

Comments (0)

Files changed (1)

tests/Tests/Distribution.hs

 -- Required for Param
 {-# LANGUAGE FlexibleInstances    #-}
 {-# LANGUAGE OverlappingInstances #-}
+{-# LANGUAGE ViewPatterns #-}
 module Tests.Distribution (
     distributionTests
   ) where
 
 -- Quantile is inverse of CDF
 quantileIsInvCDF :: (Param d, ContDistr d) => T d -> d -> Double -> Property
-quantileIsInvCDF _ d p =
+quantileIsInvCDF _ d (snd . properFraction -> p) =
   p > 0 && p < 1  ==> ( printTestCase (printf "Quantile     = %g" q )
                       $ printTestCase (printf "Probability  = %g" p )
                       $ printTestCase (printf "Probability' = %g" p')