Learn R Programming

argminCS (version 1.1.0)

lambda.adaptive.enlarge: 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,
  ...
)

Value

A list containing:

lambdaThe final (enlarged) lambda that is still feasible.
cappedLogical, TRUE if the enlargement was capped due to reaching the threshold.
residual.slepianResidual value from the feasibility check at the final lambda.
variance.boundVariance bound used in the final feasibility check.

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.

Examples

Run this code
# 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

Run the code above in your browser using DataLab