find_local_factors {l1rotation}R Documentation

Find the rotation of the loading matrix with the smallest l1-norm, as in local_factors(), with additional flexibility.

Description

Find the most sparse rotation of an orthonormal basis of the loading space of a t by n matrix X. Additional flexibility with the initial_loadings argument allows the user to specify any orthonormal basis rather than defaulting to PCA.

Usage

find_local_factors(X, r, initial_loadings, parallel = FALSE, n_cores = NULL)

Arguments

X

A (usually standardized) t by n matrix of observations.

r

An integer denoting the number of factors in X.

initial_loadings

Matrix that represents an orthonormal basis of the loading space. If not supplied, PCA is used by default in this function and also in local_factors.

parallel

A logical denoting whether the algorithm should be run in parallel.

n_cores

An integer denoting how many cores should be used, if parallel == TRUE.

Value

Returns a list with the following components:

Examples

# Minimal example with 2 factors, where X is a 224 by 207 matrix
r <- 2
M <- nrow(example_data)
n <- ncol(example_data)

# Compute PCA estimates
basis <- svd(example_data / sqrt(M), nu = M, nv = n)
initial_loadings <- sqrt(n) * basis$v[, 1:r]

# Find minimum rotation using orthonormal basis initial_loadings
rotation_result <- find_local_factors(X = example_data, r = r, initial_loadings = initial_loadings)


[Package l1rotation version 1.0.1 Index]