tests/testthat/test_prox.R

test_that("prox_sorted_L1 agrees with isotone package", {
  if (!requireNamespace("isotone", quietly = TRUE))
    skip("isotone package not available")
  n <- 20
  mu <- 1.5 * (n:1)
  y <- sort(abs(rnorm(n, mean = mu)), decreasing = TRUE)
  lambda <- n:1
  expect_equal(prox_sorted_L1_C(y, lambda),
               prox_sorted_L1_isotone(y, lambda))
})

Try the grpSLOPE package in your browser

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

grpSLOPE documentation built on May 31, 2023, 5:27 p.m.