select_sparsity | R Documentation |
Optimal Sparsity Parameter Selection for PCA
select_sparsity(
COVS,
k = 1,
rho = NULL,
cor = FALSE,
eta = seq(0, 5, by = 0.2),
gamma = seq(0, 1, 0.05),
eps_threshold = 0.001,
eps_root = 0.1,
eps_ADMM = 1e-04,
n_max = 300,
adjust_eta = FALSE,
cores = 1,
increase_rho = list(TRUE, 100, 1),
convergence_plot = FALSE,
trace = FALSE,
stop.sparse = TRUE
)
COVS |
list of covariance or correlation matrices. |
k |
number of components to be returned. |
rho |
penalty parameter for ADMM. |
cor |
logical, if starting values for covariances or correlation matrices should be used. |
eta |
vector of possible values for degree of sparsity. |
gamma |
vector of possible values for distribution of sparsity. If only one value is provided, the optimal eta is calculated. |
eps_threshold |
tolerance for thresholding. |
eps_root |
tolerance for root finder. |
eps_ADMM |
tolerance for ADMM iterations. |
n_max |
maximal number of ADMM iterations. |
adjust_eta |
if eta should be adjusted for further components. |
cores |
number of cores for parallel computing. |
increase_rho |
list of settings for improved automated calculation and convergence. See Details. |
convergence_plot |
logical, if convergence plot should be plotted. Not applicable for |
trace |
logical, if messages should be displayed. Not applicable for |
stop.sparse |
calculate if AUC should be calculated for PCAs until full sparsity is reached ( |
The input increase_rho
consists of a logical indicating if rho should be adjusted
if algorithm did not converged within the given maximal number of iterations. Two integers specify the
maximal rho
that is allowed and the step size.
Returns list with
PCA | object of type PCAloc. |
PC | local loadings of PCA |
gamma | optimal value for gamma. |
eta | optimal value for eta. |
eta_tpo | values of Trade-Off-Product for eta from optimization process. |
auc | area under the curve for varying gamma values. |
pars | parameters and respective sparsity entrywise and mixed and explained variance. |
plot | ggplot object for optimal parameter selection. |
plot_info | additional data for plotting functions. |
C1 = matrix(c(1,0,0,0.9), ncol = 2)
C2 = matrix(c(1.1, 0.1, 0.1, 1), ncol = 2)
C3 = matrix(c(1.2, 0.2, 0.2, 1), ncol = 2)
select_sparsity(COVS = list(C1, C2, C3),
k = 1,
rho = 5,
eta = c(0, 0.1, 0.15, 0.2, 0.3, 0.4, 0.5 ,0.75, 1),
gamma =c(0, 0.25, 0.5, 0.75, 1),
eps_threshold = 0.005,
increase_rho = list(FALSE, 20, 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.