File Exchange

image thumbnail

L1-PCA Toolbox

version 1.0.0.3 (22.5 KB) by Dr. Panos Markopoulos
MATLAB functions that implement exact and efficient L1-PCA solvers.

14 Downloads

Updated 24 Sep 2018

View License

Collection of MATLAB functions that implement exact and efficient L1-PCA solvers. L1-PCA is an outlier-resistant alternative to PCA/SVD.
This toolbox offers functions for the L1-PCA (K components) of data matrix X (D by N); K<rank(X)<=min(D,N).

Author: Prof. Panos Markopoulos (pxmeee@rit.edu)

****
Please, read the reference article for each code, so that you understand its complexity and performance specifics. Please, notice that l1pca_EX and l1pca are exact codes of high theoretical significance but also high computational cost with respect to the size of the analyzed matrix (in accordance with the combinatorial nature of L1-PCA). l1pca_BF is a practical solver for problems of medium/larger size.
****

Function l1pca(X,K) calculates the K exact L1-PCs of matrix X, using the polynomial-time algorithm of:
P. P. Markopoulos, G. N. Karystinos, and D. A. Pados,"Optimal algorithms for L1-subspace signal processing," IEEE Transactions on Signal Processing, vol. 62, pp. 5046-5058, Oct. 2014. Cost: Polynomial in N; exponential in rank(X).

Function l1pca_EX(X,K) calculates the K exact L1-PCs of matrix X, using the exhaustive-search algorithm of: P. P. Markopoulos, G. N. Karystinos, and D. A. Pados,"Optimal algorithms for L1-subspace signal processing," IEEE Transactions on Signal Processing, vol. 62, pp. 5046-5058, Oct. 2014. Cost: Exponential in N.

Function l1pca_BF(X,K,init,numinit,maxiter,prnt) calculates the K approximate L1-PCs of matrix X, using the bit-flipping algorithm of: P. P. Markopoulos, S. Kundu, S. Chamadia, and D. A. Pados, "Efficient L1-norm principal-component analysis via bit flipping," IEEE Transactions on Signal Processing, vol. 65, pp. 4252-4264, Aug. 2017. Cost: Quadratic in N; at most quadratic in D; at most quadratic in K; linear in rank(X).

If you use any part of this code, please cite the works referenced at the top of each script.

Comments and Ratings (3)

J Kenneth

Please, offer a demo script.

J Kenneth

Useless

>> X_ = l1pca_EX(randn(10, 10), 8);
Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and
is only accurate to 15 digits
> In nchoosek (line 92)
In l1pca_EX>mulst (line 105)
In l1pca_EX>multisets (line 98)
In l1pca_EX (line 65)
Error using zeros
Maximum variable size allowed by the program is exceeded.
Error in l1pca_EX>mulst (line 105)
x=zeros(nchoosek(n+k-1,k),k);
Error in l1pca_EX>multisets (line 98)
M=S(mulst(length(S),K));
Error in l1pca_EX (line 65)
muts=multisets(1:a,K);
>>

>> X_ = l1pca_EX(randn(10, 10), 6);
Error using zeros
Requested 25761160440576x6 (1151613.6GB) array exceeds maximum array size
preference. Creation of arrays greater than this limit may take a long time and
cause MATLAB to become unresponsive. See array size limit or preference panel
for more information.
Error in l1pca_EX>mulst (line 105)
x=zeros(nchoosek(n+k-1,k),k);
Error in l1pca_EX>multisets (line 98)
M=S(mulst(length(S),K));
Error in l1pca_EX (line 65)
muts=multisets(1:a,K);
>>

Could you please add some working demo script(s) and/or indicate input constraints.

Updates

1.0.0.3

Improved description.

1.0.0.2

Added details.

1.0.0.1

Details on the use of each function.

1.0.0.0

Edited content.

1.0.0.0

Required products (PM)

1.0.0.0

Updated contact information (PM)

1.0.0.0

Contact info updated (PM).

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor