test_U_stat_factors: Tests the (m+1)x(m+1)-minor constraints of an m-factor model...

View source: R/tests-factoranalysis.R

test_U_stat_factorsR Documentation

Tests the (m+1)x(m+1)-minor constraints of an m-factor model by the maximum of a high-dimensional U-statistic

Description

The minors are estimated by considering subsets of the data. The number of subsets as well as the subsets itself are chosen randomly. Each subset is used to form an unbiased estimate of all minors. The test statistic is the maximum of the U-statistic formed by the studentized estimates. A Gaussian multiplier bootstrap procedure is used to estimate the limiting distribution of the test statistic and to compute the p-value of the test.

Usage

test_U_stat_factors(
  X,
  factors = 2,
  N = 5000,
  E = 1000,
  random = FALSE,
  nr_minors = 10000
)

Arguments

X

Matrix with observed data. The number of columns corresponds to the number of observed variables. Each row corresponds to one sample.

factors

Integer, number of latent factors

N

Integer, computational budget parameter.

E

Integer, number of bootstrap iterations.

random

Logical. If TRUE, the minors are chosen randomly. If FALSE, all possible minors are tested.

nr_minors

Integer, number of randomly chosen minors that are tested.

Value

Named list with two entries: Test statistic (TSTAT) and p-value (PVAL).

Examples

# Covariance matrix corresponding to the two-factor analysis model
m=10
Gamma = matrix(stats::rnorm(2*m),m,2)
Psi = diag(rep(1,m))
cov = Psi + Gamma %*% t(Gamma)

# Sample data from the two-factor analysis model
X = MASS::mvrnorm(500, mu=rep(0,nrow(cov)), Sigma=cov)

# Apply the test
test_U_stat_factors(X, random=TRUE, nr_minors=100)

NilsSturma/TestGGM documentation built on June 30, 2023, 3:09 p.m.