jml.recovery
Class RobustPCA

java.lang.Object
  extended by jml.recovery.RobustPCA

public class RobustPCA
extends java.lang.Object

A Java implementation of robust PCA which solves the following convex optimization problem:
min ||A||_* + lambda ||E||_1
s.t. D = A + E
where ||.||_* denotes the nuclear norm of a matrix (i.e., the sum of its singular values), and ||.||_1 denotes the sum of the absolute values of matrix entries.

Inexact augmented Lagrange multipliers is used to solve the optimization problem due to its empirically fast convergence speed and proved convergence to the true optimal solution. Input:
D: an observation matrix with columns as data vectors
lambda: a positive weighting parameter
Output:
A: a low-rank matrix recovered from the corrupted data matrix D
E: error matrix between D and A

Version:
1.0 Nov. 20th, 2013
Author:
Mingjie Qian

Field Summary
(package private)  org.apache.commons.math.linear.RealMatrix A
          A low-rank matrix recovered from the corrupted data observation matrix D.
(package private)  org.apache.commons.math.linear.RealMatrix D
          Observation real matrix.
(package private)  org.apache.commons.math.linear.RealMatrix E
          Error matrix between the original observation matrix D and the low-rank recovered matrix A.
(package private)  double lambda
          A positive weighting parameter.
 
Constructor Summary
RobustPCA(double lambda)
          Constructor for Robust PCA.
 
Method Summary
 void feedData(org.apache.commons.math.linear.RealMatrix D)
          Feed an observation matrix.
 org.apache.commons.math.linear.RealMatrix GetErrorMatrix()
          Get the error matrix between the original observation matrix and its low-rank recovered matrix.
 org.apache.commons.math.linear.RealMatrix GetLowRankEstimation()
          Get the low-rank matrix recovered from the corrupted data observation matrix.
private static double J(org.apache.commons.math.linear.RealMatrix Y, double lambda)
           
static void main(java.lang.String[] args)
           
 org.apache.commons.math.linear.RealMatrix[] robustPCA(org.apache.commons.math.linear.RealMatrix D, double lambda)
          Compute robust PCA for an observation matrix which solves the following convex optimization problem:
min ||A||_* + lambda ||E||_1
s.t.
 void run()
          Run robust PCA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lambda

double lambda
A positive weighting parameter.


D

org.apache.commons.math.linear.RealMatrix D
Observation real matrix.


A

org.apache.commons.math.linear.RealMatrix A
A low-rank matrix recovered from the corrupted data observation matrix D.


E

org.apache.commons.math.linear.RealMatrix E
Error matrix between the original observation matrix D and the low-rank recovered matrix A.

Constructor Detail

RobustPCA

public RobustPCA(double lambda)
Constructor for Robust PCA.

Parameters:
lambda - a positive weighting parameter, larger value leads to sparser error matrix
Method Detail

main

public static void main(java.lang.String[] args)
Parameters:
args -

feedData

public void feedData(org.apache.commons.math.linear.RealMatrix D)
Feed an observation matrix.

Parameters:
D - a real matrix

run

public void run()
Run robust PCA.


GetLowRankEstimation

public org.apache.commons.math.linear.RealMatrix GetLowRankEstimation()
Get the low-rank matrix recovered from the corrupted data observation matrix.

Returns:
low-rank approximation

GetErrorMatrix

public org.apache.commons.math.linear.RealMatrix GetErrorMatrix()
Get the error matrix between the original observation matrix and its low-rank recovered matrix.

Returns:
error matrix

robustPCA

public org.apache.commons.math.linear.RealMatrix[] robustPCA(org.apache.commons.math.linear.RealMatrix D,
                                                             double lambda)
Compute robust PCA for an observation matrix which solves the following convex optimization problem:
min ||A||_* + lambda ||E||_1
s.t. D = A + E
where ||.||_* denotes the nuclear norm of a matrix (i.e., the sum of its singular values), and ||.||_1 denotes the sum of the absolute values of matrix entries.

Inexact augmented Lagrange multipliers is used to solve the optimization problem due to its empirically fast convergence speed and proved convergence to the true optimal solution.

Parameters:
D - a real observation matrix
lambda - a positive weighting parameter, larger value leads to sparser error matrix
Returns:
a RealMatrix array [A, E] where A is the recovered low-rank approximation of D, and E is the error matrix between A and D

J

private static double J(org.apache.commons.math.linear.RealMatrix Y,
                        double lambda)