lambda.adaptive.enlarge: Iteratively enlarge a tuning parameter lambda in a...

View source: R/data_driven_lambda.R

lambda.adaptive.enlargeR Documentation

Iteratively enlarge a tuning parameter \lambda in a data-driven way.

Description

Iteratively enlarge a tuning parameter \lambda to enhance the power of hypothesis testing. The iterative algorithm ends when an enlarged \lambda unlikely yields the first order stability.

Usage

lambda.adaptive.enlarge(
  lambda,
  scaled.difference.matrix,
  sample.mean = NULL,
  mult.factor = 2,
  verbose = FALSE,
  seed = NULL,
  ...
)

Arguments

lambda

The real-valued tuning parameter for exponential weightings (the calculation of softmin).

scaled.difference.matrix

A n by (p-1) difference scaled.difference.matrix matrix after column-wise scaling (reference dimension - the rest); each of its row is a (p-1)-dimensional vector of differences.

sample.mean

The sample mean of the n samples in scaled.difference.matrix; defaults to NULL. It can be calculated via colMeans(scaled.difference.matrix). If your experiment involves hypothesis testing over more than one dimension, pass sample.mean=colMeans(scaled.difference.matrix) to speed up computation.

mult.factor

In each iteration, \lambda would be multiplied by mult.factor to yield an enlarged \lambda; defaults to 2.

verbose

A boolean value indicating if the number of iterations should be printed to console; defaults to FALSE.

seed

(Optional) If provided, used to seed for tie-breaking (for reproducibility).

...

Additional arguments to is.lambda.feasible.LOO.

Value

A list containing:

lambda The final (enlarged) lambda that is still feasible.
capped Logical, TRUE if the enlargement was capped due to reaching the threshold.
residual.slepian Residual value from the feasibility check at the final lambda.
variance.bound Variance bound used in the final feasibility check.

Examples

# Simulate data
set.seed(123)
r <- 4
n <- 200
mu <- (1:20)/20
cov <- diag(length(mu))
set.seed(108)
data <- MASS::mvrnorm(n, mu, cov)
sample.mean <- colMeans(data)
diff.mat <- get.difference.matrix(data, r)
sample.mean.r <- get.sample.mean.r(sample.mean, r)
lambda <- lambda.adaptive.LOO(diff.mat, sample.mean=sample.mean.r)

# Run the enlargement algorithm
res <- lambda.adaptive.enlarge(lambda, diff.mat, sample.mean=sample.mean.r)
res
# with a seed
res <- lambda.adaptive.enlarge(lambda, diff.mat, sample.mean=sample.mean.r, seed=3)
res


argminCS documentation built on Aug. 8, 2025, 7:51 p.m.