tests/testthat/test-Penalty.R

library("testthat")

#
# BAR regression
#

test_that("Numeric penalty", {
  prior <- createBarPrior(penalty = 10)
  expect_equal(BrokenAdaptiveRidge:::getPenalty(NULL, prior), 10)
})

test_that("Unhandled penalty", {
  prior <- createBarPrior(penalty = "aic")
  expect_error(BrokenAdaptiveRidge:::getPenalty(NULL, prior))
})

Try the BrokenAdaptiveRidge package in your browser

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

BrokenAdaptiveRidge documentation built on Aug. 8, 2025, 7:36 p.m.