Package 'ReguGLH'

Title: General Linear Hypothesis Tests via Spectral Shrinkage
Description: Implements high-dimensional general linear hypothesis tests using ridge, reciprocal cubic polynomial, and user-defined analytic spectral regularizers. Provides prior-based shrinkage selection and Gaussian maximum calibration for composite tests. Implements the methods of Li, Aue and Paul (2020), "High-dimensional general linear hypothesis tests via non-linear spectral shrinkage", Bernoulli, 26(4), 2541-2571 <doi:10.3150/19-BEJ1186>.
Authors: Haoran Li [aut, cre]
Maintainer: Haoran Li <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2026-10-27 23:58:45 UTC
Source: https://github.com/cran/ReguGLH

Help Index


General Linear Hypothesis Tests via Spectral Shrinkage

Description

Implements the methods of Li, Aue and Paul (2020), including ridge, reciprocal cubic polynomial, and general analytic regularization.

Details

P-values use asymptotic approximations. A small Gaussian MANOVA study found mild finite-sample LH size inflation; see the package README and installed VALIDATION.md for the design and results. General analytic functions require an admissible contour and numerical convergence checks.

References

Li, H., Aue, A. and Paul, D. (2020). High-dimensional general linear hypothesis tests via non-linear spectral shrinkage. Bernoulli, 26(4), 2541–2571. doi:10.3150/19-BEJ1186.

See Also

glh_test, shrinkage_moments, cubic_grid


Generate a cubic coefficient search grid

Description

Generate a cubic coefficient search grid

Usage

cubic_grid(eigenvalues, resolution = 5L)

Arguments

eigenvalues

Residual covariance eigenvalues, including zeros.

resolution

Number of grid points per dimension (at least two).

Value

Matrix with columns l0,l1,l2,l3 satisfying the supplementary material's monotonicity and discriminant restrictions.

References

Li, H., Aue, A. and Paul, D. (2020). High-dimensional general linear hypothesis tests via non-linear spectral shrinkage. Bernoulli, 26(4), 2541–2571. doi:10.3150/19-BEJ1186.


Spectral shrinkage general linear hypothesis test

Description

Tests BC = 0 in Y = BX + error. Columns of Y are observations. Selection maximizes the estimated local power numerator divided by the square root of the estimated variance on a finite candidate grid.

Usage

glh_test(Y, X, C, family = c("linear", "cubic", "general"),
  mode = c("single", "composite"), prior = c(1, 0, 0),
  priors = diag(3), parameters = NULL, regularizer = NULL,
  contour = NULL, nquad = 256L, nsim = 10000L, alpha = 0.05)

Arguments

Y

Numeric p by N response matrix.

X

Numeric k by N full row rank design matrix.

C

Numeric k by q full column rank contrast matrix.

family

One of linear (ridge), cubic (reciprocal polynomial), general.

mode

Single prior test or maximum across multiple priors.

prior

Nonnegative length-three weights for a single test.

priors

Matrix of nonnegative prior rows for a composite test.

parameters

Candidate parameters; see shrinkage_moments. Defaults to 60 logarithmically spaced negative ridge parameters or cubic_grid.

regularizer

Vectorized function(z, parameter) for general shrinkage.

contour

Circular integration contour; see shrinkage_moments.

nquad

Contour quadrature node count.

nsim

Number of Gaussian simulations for composite calibration.

alpha

Significance level.

Details

Calibration is asymptotic. A small Gaussian MANOVA study found mild finite-sample LH size inflation (up to 7.6 percent at nominal 5 percent). See the package README and installed VALIDATION.md.

Value

A list with statistic, p.value and reject for LR, LH and BNP; component statistics, selected parameters, prior weights, moments, covariance before and after PSD projection, and residual dimensions.

References

Li, H., Aue, A. and Paul, D. (2020). High-dimensional general linear hypothesis tests via non-linear spectral shrinkage. Bernoulli, 26(4), 2541–2571. doi:10.3150/19-BEJ1186.

Examples

set.seed(1)
Y <- matrix(rnorm(10 * 40), 10, 40)
X <- rbind(1, rep(c(0, 1), each = 20))
C <- matrix(c(0, 1), 2, 1)
glh_test(Y, X, C)
glh_test(Y, X, C, mode = "composite", nsim = 1000)

Estimate null moments and prior power numerators

Description

Estimate null moments and prior power numerators

Usage

shrinkage_moments(eigenvalues, gamma,
  family = c("linear", "cubic", "general"), parameters,
  regularizer = NULL, contour = NULL, nquad = 256L)

Arguments

eigenvalues

Nonnegative eigenvalues of the residual covariance, including its zero eigenvalues.

gamma

Dimension divided by residual degrees of freedom.

family

One of linear, cubic, general.

parameters

Negative ridge parameters; cubic coefficient matrix with columns l0,l1,l2,l3; or matrix of user-defined parameter rows.

regularizer

Vectorized function(z, parameter) supporting complex z.

contour

List with center and radius for a counterclockwise circle. Must enclose the empirical spectrum and kernel singularities, but no singularities of the regularizers. Required for the general family.

nquad

Number of equally spaced midpoint contour nodes.

Value

List containing omega, delta, numerator (three prior basis columns), parameters, and complex numerical estimates for the general family.

References

Li, H., Aue, A. and Paul, D. (2020). High-dimensional general linear hypothesis tests via non-linear spectral shrinkage. Bernoulli, 26(4), 2541–2571. doi:10.3150/19-BEJ1186.