sparsity_mixed: Mixed Sparsity of the Loadings

View source: R/sparsePCA_helpers.R

sparsity_mixedR Documentation

Mixed Sparsity of the Loadings

Description

Mixed Sparsity of the Loadings

Usage

sparsity_mixed(PC, p, N, k = 1, tolerance = 0.001, mean = "arithmetic")

Arguments

PC

matrix-like object of PCs.

p

integer, number of variables.

N

integer, number of groups.

k

integer, which components should be used. Does not work for multiple PCs simultaneously.

tolerance

tolerance for sparsity.

mean

if "arithmetic" or "geometric" mean should be used.

Value

Returns the geometric mean of the percentage of entry-wise and group-wise sparsity.

Examples

PC = matrix(c(1,0,2,3,0,7,0,1,0,1,0.001,0), ncol = 2)
sparsity_mixed(PC, N = 2, p = 3, tolerance = 0, k = 1)
sparsity_mixed(PC, N = 2, p = 3, tolerance = 0.001, k = 2, mean = "geometric")

ssMRCD documentation built on Sept. 11, 2024, 5:14 p.m.