Welcome! Here we have source code to perform argmin hypothesis test.
The goal of argminCS is to produce confidence set of argmin from iid samples with a valid type 1 control, while exhibiting desirable statistical power. In particular, the method ‘softmin.LOO’ is the main innovative component in our paper Winners with Confidence: Argmin Inference over a High-Dimensional Discrete Candidate Set. Several other methods are also implemented within the package to ease method comparison and simulations.
If you use the argminCS package for your research or any experiment, please cite our paper “Winners with Confidence: Argmin Inference over a High-Dimensional Discrete Candidate Set”.
You can install the development version of argminCS from this GitHub webpage with:
# install.packages("devtools")
::install_github("xu3cl4/argminCS") devtools
This is a basic example which shows you how to solve a common problem:
library(argminCS)
<- 4
dimension <- 200
sample.size <- 20
p <- (1:p)/p
mu <- diag(length(mu))
cov set.seed(108)
<- MASS::mvrnorm(sample.size, mu, cov)
data
## to test if 'dimension' is likely to be argmin with (default) softmin.LOO
<- matrix(rep(data[, dimension], p-1),
difference.matrix ncol = p-1,
byrow = FALSE) - data[, -dimension]
argmin.HT(difference.matrix, method='SML')
#> $test.stat.scale
#> [1] 2.274283
#>
#> $critical.value
#> [1] 1.644854
#>
#> $std
#> [1] 1
#>
#> $ans
#> [1] "Reject"
#>
#> $lambda
#> [1] 1.94368e+11
#>
#> $lambda.capped
#> [1] TRUE
#>
#> $residual.slepian
#> [1] 0
#>
#> $variance.bound
#> [1] 0.0842562
## rather than perform a hypothesis testing for a specific dimension,
## one can directly generate a discrete confidence set by
CS.argmin(data, method='SML')
#> [1] 1 2
Here is a detailed tutorial.
Regarding other details of methods, we encourage users to install the package and check function documentation.
There are two differentially private loss matrices provided in this package for reproducibility. You can access them via
<- system.file("extdata", "loss_matrix_2023_differentially_private.csv", package = "argminCS")
file_2023 .2023 <- read.csv(file_2023)
losshead(loss.2023[,1:5])
#> V1 V2 V3 V4 V5
#> 1 0 0 0 0 0
#> 2 0 0 0 0 0
#> 3 0 0 0 0 0
#> 4 0 1 0 0 0
#> 5 0 0 0 0 0
#> 6 0 0 0 0 0
dim(loss.2023)
#> [1] 183 44
<- system.file("extdata", "loss_matrix_2024_differentially_private.csv", package = "argminCS")
file_2024 .2024 <- read.csv(file_2024)
losshead(loss.2024[,1:5])
#> V1 V2 V3 V4 V5
#> 1 0 0 0 1 0
#> 2 0 0 0 0 0
#> 3 0 0 0 0 0
#> 4 0 0 0 0 0
#> 5 0 0 0 0 0
#> 6 0 0 0 0 0
dim(loss.2024)
#> [1] 1236 39