https://github.com/cran/scModels
Revision 0dc168df0baeea977e8d8e2f8c37f41eb57a5b73 authored by Lisa Amrhein on 02 September 2019, 23:00:09 UTC, committed by cran-robot on 02 September 2019, 23:00:09 UTC
1 parent 52f2e41
Tip revision: 0dc168df0baeea977e8d8e2f8c37f41eb57a5b73 authored by Lisa Amrhein on 02 September 2019, 23:00:09 UTC
version 1.0.1
version 1.0.1
Tip revision: 0dc168d
test-discrete-sum.R
test_that("Discrete probabilities sum to unity", {
expect_equal(sum(dpb(0:100, 5, 3, 20)), 1)
expect_equal(sum(dpb(x = 0:4000, alpha = 1.05, beta = 5.5, c = 709)), 1)
expect_equal(sum(dpb(x = 0:4000, alpha = 1.05, beta = 5.5, c = 2009)), 1)
expect_equal(sum(dpb(x = 0:4000, alpha = 1.05, beta = 5.5, c = 4009)), 1)
})

Computing file changes ...