kernel {DiscreteFDR}R Documentation

Kernel functions


Kernel functions that transform observed p-values or their support according to [HSU], [HSD], [AHSU], [AHSD] and [HBR-\lambda]. The output is used by discrete.BH or DBR, respectively. Additionally, kernel.DBH.crit, kernel.ADBH.crit and kernel.DBR.crit compute and return the critical constants. The end user should not use these functions directly.


kernel_DBH_fast(pCDFlist, pvalues, stepUp = FALSE, alpha = 0.05, support = 0L)

kernel_DBH_crit(pCDFlist, pvalues, sorted_pv, stepUp = FALSE, alpha = 0.05)

kernel_ADBH_fast(pCDFlist, pvalues, stepUp = FALSE, alpha = 0.05, support = 0L)

kernel_ADBH_crit(pCDFlist, pvalues, sorted_pv, stepUp = FALSE, alpha = 0.05)

kernel_DBR_fast(pCDFlist, pvalues, lambda = 0.05)

kernel_DBR_crit(pCDFlist, pvalues, sorted_pv, lambda = 0.05, alpha = 0.05)



a list of the supports of the CDFs of the p-values. Each support is represented by a vector that must be in increasing order.


a numeric vector. Contains all values of the p-values supports if we search for the critical constants. If not, contains only the observed p-values. Must be sorted in increasing order!


a numeric vector. Identical to pvalues for a step-down procedure. Equals c.m for a step-up procedure.


the target FDR level, a number strictly between 0 and 1. For *.fast kernels, it is only necessary, if stepUp = TRUE.


a numeric vector. Contains all values of the p-values supports. Ignored, if stepUp = FALSE. Must be sorted in increasing order!


a vector of observed p-values, in increasing order.


a number strictly between 0 and 1. If lambda=NULL (by default), then lambda is chosen equal to alpha.


When computing critical constants under step-down, that is, when using kernel.DBH.crit, kernel.ADBH.crit or kernel.DBR.crit with stepUp = FALSE (i.e. the step-down case), we still need to get transformed p-values to compute the adjusted p-values.

This version: 2019-11-15.


For, and, a vector of transformed p-values is returned. kernel.DBH.crit, kernel.ADBH.crit and kernel.DBR.crit return a list object with critical constants ($crit.consts) and transformed p-values ($pval.transf), but if stepUp = FALSE, there are critical values only.

See Also

discrete.BH, DiscreteFDR, DBR


X1 <- c(4, 2, 2, 14, 6, 9, 4, 0, 1)
X2 <- c(0, 0, 1, 3, 2, 1, 2, 2, 2)
N1 <- rep(148, 9)
N2 <- rep(132, 9)
Y1 <- N1 - X1
Y2 <- N2 - X2
df <- data.frame(X1, Y1, X2, Y2)

#Construction of the p-values and their support
df.formatted <- = df, input = "noassoc")
raw.pvalues <- df.formatted$raw
pCDFlist <- df.formatted$support

alpha <- 0.05

# Compute the step functions from the supports

# We stay in a step-down context, where pv.numer = pv.denom,
# for the sake of simplicity

# If not searching for critical constants, we use only the observed p-values
sorted.pvals <- sort(raw.pvalues) <- kernel_DBH_fast(pCDFlist, sorted.pvals) <- kernel_ADBH_fast(pCDFlist, sorted.pvals)
# transformed values

# compute transformed support
pv.list <- sort(unique(unlist(pCDFlist)))
y.DBH.crit <- kernel_DBH_crit(pCDFlist, pv.list, sorted.pvals)
y.ADBH.crit <- kernel_ADBH_crit(pCDFlist, pv.list, sorted.pvals)
y.DBR.crit <- kernel_DBR_crit(pCDFlist, pv.list, sorted.pvals)
# critical constants
# The following exist only for step-down direction or DBR

[Package DiscreteFDR version 1.3.6 Index]