haskell / statistics

A fast, high quality library for computing with statistics in Haskell.
http://hackage.haskell.org/package/statistics
BSD 2-Clause "Simplified" License
300 stars 68 forks source link

Failing quickcheck test #123

Closed Gabriella439 closed 4 years ago

Gabriella439 commented 7 years ago

I ran into the following test failure and just wanted to report it:

    Discrete CDF is OK: [Failed]
*** Failed! Falsifiable (after 6 tests): 
binomial 97 0.7565660170770951
N= 31    p[i]=2.0721354043840986e-20    p[i+1]=1.4030111345155002e-19   dP=1.1957975940770737e-19   relerr=1.183963930270319e-14
N= 65    p[i]=2.0389951564727095e-2 p[i+1]=3.406355217403261e-2 dP=1.3673600609305064e-2    relerr=1.3291709124073608e-14

(used seed -3743963060631687162)
Gabriella439 commented 7 years ago

I forgot to mention that this is with statistics-0.14.0.2

Anton-Latukha commented 6 years ago

I confirm hitting this one. Environment and syndromes match.

GNU/Linux 4.9.53 x86_64 NixOS
Nix package: haskellPackages.statistics_0_14_0_2
Locale: en_US.UTF-8
...
    Discrete CDF is OK: [Failed]
*** Failed! Falsifiable (after 2 tests): 
binomial 90 0.5054269843655128
N= 26    p[i]=9.444615679210591e-6  p[i+1]=2.4888822554204667e-5    dP=1.5444206874993732e-5    relerr=1.3749196449348567e-14

(used seed -2074542166724424470)
    log probabilty check: [OK, passed 100 tests]
  Tests for: GeometricDistribution:
    C.D.F. sanity: [OK, passed 100 tests]
    CDF limit at +inf: [OK, passed 100 tests]
    CDF limit at -inf: [OK, passed 100 tests]
    CDF at +inf = 1: [OK, passed 100 tests]
    CDF at -inf = 1: [OK, passed 100 tests]
    CDF is nondecreasing: [OK, passed 100 tests]
    1-CDF is correct: [OK, passed 100 tests]
    Prob. sanity: [OK, passed 100 tests]
    CDF is sum of prob.: [OK, passed 100 tests]
    Discrete CDF is OK: [Failed]
*** Failed! Falsifiable (after 46 tests): 
geometric 8.588751892668611e-4
N=  2    p[i]=8.588751892668611e-4  p[i+1]=1.7170127119430223e-3    dP=8.581375226761229e-4 relerr=2.2290071833788697e-14
N=  4    p[i]=2.5744132015919075e-3 p[i+1]=3.4310772912330423e-3    dP=8.566640896410928e-4 relerr=1.2260593604208707e-14
N=  5    p[i]=3.4310772912330423e-3 p[i+1]=4.287005613342054e-3 dP=8.559283221089641e-4 relerr=1.1153079822850185e-14
N= 10    p[i]=7.703373856967732e-3  p[i+1]=8.555632809555291e-3 dP=8.522589525874647e-4 relerr=1.1024969292849045e-14

(used seed -7941117446246508541)
...

statistics-0.14.0.2.log

As also hitting #42 one.

ocramz commented 6 years ago

I can reproduce:

    Discrete CDF is OK: [Failed]
*** Failed! Falsifiable (after 15 tests): 
binomial 97 0.6520651223523526
N= 31    p[i]=6.62726678933811e-12  p[i+1]=2.7239842052369202e-11   dP=2.0612575263030772e-11   relerr=1.1743322589600657e-14

(used seed -142533318321840118)
mightybyte commented 6 years ago

Bump. I'm also getting this failure. I'm running macOS with the most recent commit (1ed1f28).

    Discrete CDF is OK: [Failed]
*** Failed! Falsifiable (after 18 tests):
binomial 99 0.89617703670166
N= 60    p[i]=6.883822294017256e-15     p[i+1]=3.994480899936055e-14    dP=3.306098670534285e-14        relerr=1.1217302207471003e-14

(used seed -8475207131145061897)
Shimuuar commented 4 years ago

Fixed as of e69e033d27f6d1afba0cb1b2e49a8935ed7dd4a1