tests/testthat/test-modelSelection.R

test_that("model.selection.criteria works", {
  data("example1")
  fit.BCC <- example1
  res <- model.selection.criteria(fit.BCC, fast_version=T)

  expect_equal(res$DIC, 3026.2626)
  expect_equal(res$WAIC, 2884.56245)
  expect_equal(res$WBIC, 1436.34092)
})

test_that("model.selection.criteria fail", {
  data("example1")
  fit.BCC <- example1

  expect_error(model.selection.criteria(fit.BCC, fast_version=2),
               "fast_version should be either TRUE or FALSE")
  expect_error(model.selection.criteria("a", fast_version=T),
               "Object was created without names")
})

Try the BCClong package in your browser

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

BCClong documentation built on June 24, 2024, 1:07 a.m.