diff --git a/R/colocboost_inference.R b/R/colocboost_inference.R index 7406989..eb04444 100644 --- a/R/colocboost_inference.R +++ b/R/colocboost_inference.R @@ -25,7 +25,10 @@ colocboost_post_inference <- function() { } -# - Fast calculate correlation matrix +#' Fast calculate correlation matrix +#' @rdname colocboost_post_inference +#' @keywords cb_post_inference +#' @noRd get_cormat <- function(X, intercepte = FALSE){ X = t(X) # Center each variable diff --git a/tests/testthat/test_utils.R b/tests/testthat/test_utils.R index 0ce5891..f401ce9 100644 --- a/tests/testthat/test_utils.R +++ b/tests/testthat/test_utils.R @@ -32,7 +32,7 @@ test_that("w_cs correctly identifies confidence set for weight vector", { # Test with different coverage result2 <- w_cs(w, coverage = 0.9) - expected2 <- c(1, 1, 1, 0) # First 3 elements cover 90% + expected2 <- c(1, 1, 1, 1) # First 4 elements cover 90% since 3 and 4 with the same 0.1 weight expect_equal(result2, expected2) }) @@ -51,8 +51,8 @@ test_that("get_in_cos correctly identifies indices in confidence set", { # Test with higher coverage result2 <- get_in_cos(w, coverage = 0.9) - # Should include elements 2, 3, 1, 4 - expect_equal(sort(result2[[1]]), c(1, 2, 3, 4)) + # Should include elements 2, 3, 1, 4, 5 + expect_equal(sort(result2[[1]]), c(1, 2, 3, 4, 5)) }) # Test for merge_sets function