Computes the signed maximum statistic $$W_j = \max(Z_j, \tilde{Z}_j) \cdot \mathrm{sgn}(Z_j - \tilde{Z}_j),$$ where \(Z_j\) and \(\tilde{Z}_j\) are the maximum values of \(\lambda\) at which the jth variable and its knockoff, respectively, enter the generalized linear model.

stat_modelY_maxlam(
  X,
  Y,
  Yk,
  generate_lambda = TRUE,
  nlambda = 100,
  standardize = TRUE
)

Arguments

X

n-by-p matrix of quantitative predictors.

Y

n-by-r matrix of original responses.

Yk

n-by-r matrix of knockoff responses.

generate_lambda

whether to use the method in the YKnock paper to generate lambda sequence. If not, it will use the method of glmnet package to generate lambda.

nlambda

The number of lambda values - default is 100.

standardize

Logical flag for Y variable standardization. Default is standardize=TRUE.

Value

A r-by-2 matrix of statistics \(Z\).

Details

This function uses glmnet to compute the regularization path on a fine grid of \(\lambda\)'s.