BBUM_FDR: False discovery rate by the BBUM model

View source: R/BBUM_FDR.R

BBUM_FDRR Documentation

False discovery rate by the BBUM model

Description

BBUM_FDR computes the false discovery rate (FDR) value at quantiles q (raw p-values) according to the given parameters of the BBUM distribution.

Usage

BBUM_FDR(q, lambda, a, theta, r, dtratio = Inf)

Arguments

q

Vector of quantiles.

lambda

Vector of BBUM parameter lambda. lambda is the fraction of null (uniform distribution density) over all density except the primary beta distribution, i.e. null plus secondary beta.

a

Vector of BBUM parameter a, which corresponds to the a shape parameter of the secondary beta distribution component. It describes the steepness of the second beta distribution.

theta

Vector of BBUM parameter theta. theta is the fraction of primary beta distribution density over all density.

r

Vector of BBUM parameter r, which is the ratio of the a shape parameter of the primary beta distribution over that of the secondary beta distribution. In other words, a*r is the shape parameter for the primary beta distribution component.

dtratio

If using the "two-tailed" case of BBUM correction, provide the ratio of number of data points in the signal class over that in the background class. Leave as Inf for the "one-tailed" case (the default). See Details.

Details

This modifed FDR is defined to include primary signal and exclude both secondary signal and null.

If the background assumption is weak, such that a small number of bona fide hits are anticipated and relevant to the hypothesis at hand among the data points designated "background class", the FDR could be made to include the background class. This is akin to a two-tailed test (despite a one-tailed assumption to begin with). This would allow the generation of genuine FDR-corrected p values for the background class points as well. Toggle this using the dtratio value.

Value

A vector of FDR values at each value of q.

Examples

# Default
BBUM_FDR(q = c(0.001, 0.007, 0.19, 0.5, 0.99),
  lambda = 0.65, a = 0.1, theta = 0.02, r = 0.07)
# "Two-tailed"
BBUM_FDR(q = c(0.001, 0.007, 0.19, 0.5, 0.99),
  lambda = 0.65, a = 0.1, theta = 0.02, r = 0.07, dtratio = 1.13)


wyppeter/bbum documentation built on Oct. 3, 2023, 3:29 p.m.