This function calculates the false discovery rate and true positive rate based on selected variables, known null variables (negatives), and known non-null variables (positives).

perf_eval(selected, positives, negatives)

Arguments

selected

A vector of indices of selected variables.

positives

A vector of indices of known non-null variables.

negatives

A vector of indices of known null variables.

Value

A numeric vector of length 2 containing: - `tpr`: The true positive rate. - `fdr`: The false discovery rate.

Examples

perf_eval(selected = c(1, 2, 3, 5), positives = 1:4, negatives = 5:10)
#> [1] 0.75 0.25