Nothing
context("quad.h unit tests")
f <- function(x) dnorm(x)
test_that("Definite integral", {
R_value <- stats::integrate(f, 0, 2)$value
expect_equal(hesim:::test_quad_dnorm(0, 2),
R_value)
})
test_that("Indefinite integral", {
# Lower bound to infinity
R_value <- stats::integrate(f, lower = 0, upper = Inf)$value
expect_equal(hesim:::test_quad_dnorm(0, Inf),
R_value)
# -Infinity to upper bound
R_value <- stats::integrate(f, lower = -Inf, upper = 1)$value
expect_equal(hesim:::test_quad_dnorm(-Inf, 1),
R_value)
# -Infinity to Infinity
R_value <- stats::integrate(f, lower = -Inf, upper = Inf)$value
expect_equal(hesim:::test_quad_dnorm(-Inf, Inf),
R_value)
})
test_that("Warnings and errors", {
expect_warning(hesim:::test_quad_ier1())
expect_warning(hesim:::test_quad_ier4())
expect_warning(hesim:::test_quad_ier5())
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.