Learn R Programming

bayefdr (version 0.2.1)

efdr_search: Bayesian EFDR optimisation.

Description

Given a vector of probabilities, this function finds the probability threshold that matches a target expected false discovery rate as closely as possible.

Usage

efdr_search(
  probs,
  target_efdr,
  min_threshold = 0.7,
  prob_thresholds = seq(0.5, 0.9995, by = 0.00025)
)

Value

An object of class "bayefdr" containing the probability thresholds tested, the EFDR and EFNR at each probability threshold, and the optimal threshold.

Arguments

probs

Vector of probabilities.

target_efdr

Numeric scalar specifying the expected false discovery rate to match.

min_threshold

Minimum probability threshold. If the optimal probability threshold is below this number, it is rejected and min_threshold is used instead.

prob_thresholds

Vector for probability thresholds to scan, with the aim of finding the threshold that matches the target EFDR.

Examples

Run this code
 probs <- runif(100)
 efdr <- efdr_search(probs, target_efdr = 0.1)
 plot(efdr)

Run the code above in your browser using DataLab