library(gsdmvn)
context("Initial grid and weights for numerical integration")
test_that("Testing h1() vs known results from gsProbability",{
x <- gsDesign::gsProbability(k=2, n.I=1:2, theta = 2, a= rep(-.5,2), b=c(1,3))
expect_lt(
abs(h1(theta = 2, I = 1, b= -.5) %>% summarize(plower1 = sum(h)) %>% as.numeric() - x$lower$prob[1]),
1e-6
)
expect_lt(
abs(h1(theta = 2, I = 1, a = 1) %>% summarize(plower1 = sum(h)) %>% as.numeric() - x$upper$prob[1]),
1e-6
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.