# Applying forward search with PCAasymp while evaluating
# all valid values of k (early_stop = FALSE)
n <- 200
S <- cbind(rnorm(n, sd = 2), rnorm(n, sd = 1.5),
rnorm(n), rnorm(n), rnorm(n))
A <- rorth(5)
X <- S %*% t(A)
result <- kSearch(
X = X,
method = PCAasymp,
alpha = 0.05,
search = "forward",
early_stop = FALSE
)
result
Run the code above in your browser using DataLab