calibration_bootstap: Calibration of post hoc bound using bootstrap permutations

View source: R/bootstrapCalibration.R

calibration_bootstapR Documentation

Calibration of post hoc bound using bootstrap permutations

Description

Compute by bootstraping a Joint Error Rate controlling threshold family associated to a set of contrast in a linear model.

Usage

calibration_bootstap(
  Y,
  X,
  C,
  alternative = c("two.sided", "less", "greater"),
  B = 1000,
  alpha = 0.05,
  family = c("Simes", "Linear", "Beta", "Oracle")
)

Arguments

Y

A data matrix of size $n$ observations (in row) and $D$ features in columns

X

A design matrix of size $n$ observations (in row) and $p$ variables (in columns)

C

A contrast matrix of size $L$ tested contrasts (in row) and $p$ columns corresponding to the parameters to be tested

alternative

A character string specifying the alternative hypothesis. Must be one of "two.sided" (default), "greater" or "less".

B

An integer value, the number of bootstraps

alpha

A numeric value in ⁠[0,1]⁠, the target (JER) risk

family

A character value, the name of a threshold family. Should be one of "Linear", "Beta" and "Simes", or "Oracle". "Linear" and "Simes" families are identical.

  • Simes/Linear: The classical family of thresholds introduced by Simes (1986). This family yields JER control if the test statistics are positively dependent (PRDS) under H0.

  • Beta: A family of thresholds that achieves marginal kFWER control under independence

  • Oracle A family such that the associated bounds correspond to the true numbers/proportions of true/false positives. "truth" must be available in object$input$truth.

Value

A list with elements:

thr

A numeric vector of length K, such that the estimated probability that there exists an index k between 1 and K such that the k-th maximum of the test statistics of is greater than thr[k], is less than alpha

piv_stat

A vector of B pivotal statitics

lambda

A numeric value, the result of the calibration

References

Davenport, S., Thirion, B., & Neuvial, P. (2025). FDP control in mass-univariate linear models using the residual bootstrap. Electronic Journal of Statistics, 19(1), 1313-1336.

Blanchard, G., Neuvial, P., & Roquain, E. (2020). Post hoc confidence bounds on false positives using reference families.

Examples

N = 100
p = 2
D = 2
X <- matrix(0,nrow = N, ncol = p)
X[,1] <- 1
X[,-1] <- runif(N*(p-1), min = 0, max = 3)
beta <- matrix(0, nrow = p, ncol = D)
epsilons <- matrix(rnorm(N*D), nrow = N, ncol = D)
Y <- X %*% beta + epsilons
C <- diag(p)
resLM <- calibration_bootstap(Y = Y, X = X, C = C, B = 10)

pneuvial/sanssouci documentation built on July 4, 2025, 3:16 p.m.