eval_objective: Objective function value for local sparse PCA

View source: R/sparsePCA_helpers.R

eval_objectiveR Documentation

Objective function value for local sparse PCA

Description

Objective function value for local sparse PCA

Usage

eval_objective(PC, eta, gamma, COVS)

Arguments

PC

vectorised component to evaluate.

eta

degree of sparsity.

gamma

distribution of sparsity between groupwise (\gamma = 1) and entrywise (\gamma = 0) sparsity.

COVS

list of covariance matrices used for PCA

Value

Returns value of the objective function for given v.

Examples

S1 = matrix(c(1, 0.9, 0.8, 0.5,
              0.9, 1.1, 0.7, 0.4,
              0.8, 0.7, 1.5, 0.2,
              0.5, 0.4, 0.2, 1), ncol = 4)
S2 = t(S1)%*% S1
S2 = S2/2

eval_objective(PC = c(1,0,0,0,sqrt(2),0,0,-sqrt(2)),
               eta = 1, gamma = 0.5,
               COVS = list(S1, S2))

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