tpm: Truncated Power Method

tpmR Documentation

Truncated Power Method

Description

Returns the leading sparse principal component of a matrix using the truncated power method.

Usage

tpm(Sigma, k, maxIter = 200L, verbose = TRUE, timeLimit = 10L)

Arguments

Sigma

A matrix. The correlation or covariance matrix, whose sparse PCs will be computed.

k

An integer. Target sparsity of the PC.

maxIter

(optional) An integer. Maximum number of iterations of the algorithm. Default 200.

verbose

(optional) A Boolean. Controls console output. Default TRUE.

timeLimit

(optional) An integer. Maximum time in seconds. Default 10.

Value

An object with 3 fields: 'x_best' (p x 1 array containing the sparse PC), 'objective_value', 'runtime'.

References

Yuan, X. T., & Zhang, T. (2013). Truncated power method for sparse eigenvalue problems. The Journal of Machine Learning Research, 14(1), 899-925.

Examples

library(datasets)
TestMat <- cor(datasets::mtcars)
tpm(TestMat, 4)

msPCA documentation built on May 16, 2026, 1:08 a.m.

Related to tpm in msPCA...