context("loglik_aci.R")
test_that("O, R, and pen must be positive", {
expect_error(loglik_aci(1, -1, 1, 0),
'Error: O, R, and pen must have non-negative values')
expect_error(loglik_aci(1, 1, -1, 0),
'Error: O, R, and pen must have non-negative values')
expect_error(loglik_aci(1, 1, 1, -1),
'Error: O, R, and pen must have non-negative values')
})
test_that("dimensions of par, O, and R must agree", {
expect_error(
loglik_aci(rnorm(100), matrix(1, 10, 10), matrix(1, 10, 15), 0),
'Error: dimensions of O, R, and pen must agree'
)
expect_error(
loglik_aci(rnorm(100), matrix(1, 10, 10), matrix(1, 10, 15), 0),
'Error: dimensions of O, R, and pen must agree'
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.