Learn R Programming

ssMRCD (version 1.1.0)

sparsePCAloc: Calculate Sparse Principle Components

Description

Calculate Sparse Principle Components

Usage

sparsePCAloc(
  eta,
  gamma,
  COVS,
  cor = FALSE,
  rho = NULL,
  k = NULL,
  eps_threshold = NULL,
  eps_ADMM = 1e-04,
  n_max = 200,
  eps_root = 0.1,
  maxiter_root = 50,
  increase_rho = list(TRUE, 100, 1),
  convergence_plot = TRUE,
  starting_value = NULL,
  adjust_eta = TRUE,
  trace = TRUE
)

Value

An object of class "PCAloc" containing the following elements:

PCMatrix of dimension Np x k of stacked loading vectors.
pNumber of variables.
NNumber of neighborhoods.
kNumber of components.
COVSList of covariance matrices sorted by neighborhood.
gammaSparsity distribution.
etaAmount of sparsity.
convergedLogical, if ADMM converged with given specifications.
n_stepsNumber of steps used.
summaryDescription of result per component.
residualsPrimary and secondary residuals.

Arguments

eta

numeric, degree of sparsity.

gamma

numeric, distribution of sparsity.

COVS

list of covariance or correlation matrices.

cor

logical, if starting value for correlation or covariance matrices should be used.

rho

numeric bigger than zero, penalty for ADMM.

k

number of components to calculate.

eps_threshold

tolerance for thresholding.

eps_ADMM

tolerance for ADMM convergence.

n_max

number of maximal iterations.

eps_root

tolerance for root finder.

maxiter_root

maximal number of iterations for root finder.

increase_rho

list with entries for stable convergence. See Details.

convergence_plot

logical, if convergence plot should be displayed.

starting_value

optional given starting value.

adjust_eta

logical, if eta should be adjusted by the variance.

trace

logical, if messages should be displayed.

Details

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.

Examples

Run this code
C1 = diag(c(1.1, 0.9, 0.6))
C2 = matrix(c(1.1, 0.1, -0.1,
              0.1, 1.0, -0.2,
             -0.1, -0.2, 0.7), ncol = 3)
C3 = (C1 + C2)/2

sparsePCAloc(eta = 1, gamma = 0.5, cor = FALSE, COVS = list(C1, C2, C3),
             n_max = 100, increase_rho = list(FALSE, 100, 1))

Run the code above in your browser using DataLab