lambda.adaptive.LOO {argminCS} | R Documentation |
Generate a scaled.difference.matrix-driven \lambda
for LOO algorithm.
Description
Generate a scaled.difference.matrix-driven \lambda
for LOO algorithm motivated by the derivation of the first order stability.
For its precise definition, we refer to the paper Zhang et al 2024.
Usage
lambda.adaptive.LOO(
scaled.difference.matrix,
sample.mean = NULL,
const = 2.5,
seed = NULL
)
Arguments
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). |
const |
A scaling constant for the scaled.difference.matrix driven |
seed |
(Optional) If provided, used to seed for tie-breaking (for reproducibility). |
Value
A scaled.difference.matrix-driven \lambda
for LOO algorithm.
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)