Skip to contents

Determines if all true active variables are included in at least one of the provided confidence sets. Returns TRUE if every element of true_active appears in the union of the sets, and FALSE otherwise.

Usage

is_covered(confidence_sets, true_active)

Arguments

confidence_sets

A list of integer vectors, each representing a confidence set of selected variable indices. If a single vector is provided, it will be coerced to a list of length one.

true_active

Integer vector of true active variable indices.

Value

Logical scalar. TRUE if all elements of true_active are contained in the union of confidence_sets, FALSE otherwise.

Examples

# Single set, true actives 1 and 3 are both covered
is_covered(confidence_sets = c(1, 3, 5), true_active = c(1, 3))
#> [1] TRUE

# Multiple sets, true active 2 appears in one of them
sets <- list(cs1 = c(1,4), cs2 = c(2,5), cs3 = c(3))
is_covered(confidence_sets = sets, true_active = c(2,3))
#> [1] TRUE

# Not covered if any true active is missing
is_covered(confidence_sets = list(c(1,4)), true_active = c(1,2))
#> [1] FALSE