Skip to content

Commit

Permalink
Relax precision for Binomial test
Browse files Browse the repository at this point in the history
This should fix failure found in #166:

   log probabilty check: FAIL
     *** Failed! Falsified (after 34 tests):
     binomial 79 9.83897381493678e-2
     7
     probability    = 0.14935400356648396
     logProbability = -1.9014359280741342
     log p          = -1.9014359280741266
     eps            = 3.970429114115656e-15

It turns out that main contribution to error in probability is (1-p)^(n-k) and
for logProbability we subtract values of same magnitude with usual consequences
for precision
  • Loading branch information
Shimuuar committed Jan 7, 2022
1 parent e8a435e commit 2dab001
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/Tests/Distribution.hs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ instance Param ChiSquared where

instance Param BinomialDistribution where
prec_discreteCDF _ = 1e-13

prec_logDensity _ = 48
instance Param CauchyDistribution where
-- Distribution is long-tailed enough that we may never get to zero
cdfLimitAtNegInfinity_enabled _ = False
Expand Down

0 comments on commit 2dab001

Please sign in to comment.