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

Problems with beta distrbution #161

Open Shimuuar opened 4 years ago

Shimuuar commented 4 years ago

Test for quantile inverse fails spectacularly:

      Quantile is CDF inverse: FAIL
        *** Failed! Falsified (after 99 tests):
        improperBetaDistr 1.9354985700057857e-2 9.298452506189731
        Double01 0.7873411995889938
        Quantile      = 9.435096862311606e-5
        Probability   = 0.7873411995889938
        Probability'  = 0.8812454856896215
        Rel. error    = 0.10655860100905087
        Abs. error    = 9.390428610062762e-2
        Expected err. = 16.346348384470552
        Distance      = 845814615782558
        Err/est       = 5.1743337159392945e13 <---
        Use --quickcheck-replay=315907 to reproduce.

This is really bug in incompleteBeta and/or invIncompleteBeta. Actual roundtrip error is so bad: 1e13 larger that expected that there's no point in clearing

Probably related: bos/math-functions#32