tests/testthat/test-mapit_pvalues.R

test_that(
    "saddlepoint approximation and davies similar results", {
        # given
        x <- c(1, 5, 11, 15, 20)
        lambda <- rep(1, 10)
        # when
        davies_results <- c()
        saddle_results <- c()
        for (i in x) {
            saddle_results <- c(saddle_results, saddlepoint_approximation(i, lambda))
            davies_results <- c(davies_results, davies(i, lambda = lambda)$Qq)
        }
        # then
        expect_equal(saddle_results, davies_results, tolerance = 0.001)
    }
)

Try the mvMAPIT package in your browser

Any scripts or data that you put into this service are public.

mvMAPIT documentation built on Sept. 26, 2023, 9:07 a.m.