Skip to contents

Given a list of simulation results where each run may return multiple confidence sets (e.g. cs1, cs2, …), this function enumerates the distinct patterns of sets, counts how often each occurs, computes the fraction of simulations, and tests whether the union of all sets in a pattern covers the true active variables. Within each pattern, the individual sets are ordered first by their size (smallest first), then lexicographically by their indices.

Usage

summarize_cs(cs_list, true_active, decimal = 2)

Arguments

cs_list

List of length n_sims. Each element is either:

  • an R list (e.g. list(cs1=..., cs2=..., …)) of integer vectors,

  • NULL or an empty list, meaning no confidence sets returned.

Each inner integer vector holds the indices in a single confidence set.

true_active

Integer vector of the true active variable indices.

decimal

Nonnegative integer.

Value

A data.frame with columns:

set

Character: each unique simulation pattern rendered as comma‐separated set literals, e.g.\ "{1,4}, {2,3}". An empty pattern is shown as "{}".

count

Integer: number of simulations that produced exactly that pattern of sets.

percent

Numeric: count divided by n_sims.

cover

Logical: TRUE if the union of all sets in the pattern contains every element of true_active.

Rows are sorted in descending order of count.