ROBUST PCA · PRINCIPAL COMPONENT PURSUIT · LOW RANK + SPARSE · RUNS IN YOUR BROWSER · NOTHING UPLOADED

Which cells of this table break the pattern the rest share?

Paste a table whose rows repeat the same measurements: days by hours of electricity load, stores by weeks of sales, sensors by readings, students by test items. Robust PCA, here as principal component pursuit (Candès, Li, Ma & Wright 2011), splits it into two tables that add back up to it: a low-rank part, the few shapes every row is a mix of, and a sparse part, the cells no mix of those shapes explains.

You get the rows and cells that break the pattern most, by how much, the empty cells filled in, and a certificate of how close the split is to the best possible.

Nothing you enter leaves this browser tab. Statistical output from data you supply, not advice. Not legal, tax, or financial advice.

Your data

Empty cells are allowed; the tool fills them from the low-rank part.

Numeric columns that form the table
Paste data to choose columns.

Method and citation

The problem. Principal component pursuit (Candès, Li, Ma & Wright 2011) looks for the split M = L + S that minimises ‖L‖* + λ‖S‖₁: the nuclear norm of L (the sum of its singular values, which rewards few shared patterns) plus λ times the sum of the absolute values of S (which rewards few nonzero cells). With λ = 1/√max(rows, columns) the paper proves that, when the table really is a low-rank matrix plus a sparse set of gross errors in random places, this convex problem recovers both exactly, without being told the rank or how many cells are corrupted. Empty cells are dropped from the constraint (the paper's equation 1.4), so the low-rank part fills them.

The solver. The inexact augmented Lagrange multiplier method (Lin, Chen & Ma 2010, Algorithm 5) alternates two closed-form steps: L is the singular value thresholding of M − S + Y/μ at 1/μ, S is the soft thresholding of M − L + Y/μ at λ/μ, then the multiplier Y moves by μ(M − L − S) and μ grows by a factor of 1.05. It stops when ‖M − L − S‖_F ≤ 10⁻⁷‖M‖_F. The singular value decomposition is a one-sided Jacobi SVD (Hestenes 1958), warm-started from the previous iteration. Then the answer is certified: Y, scaled until ‖Y‖₂ ≤ 1 and max|Yᵢⱼ| ≤ λ, is a feasible point of the dual problem, so ⟨Y, M⟩ is a lower bound on the optimum, and the gap to the split's own objective is reported.

Reading noisy data. Real tables are low rank plus sparse plus a little noise everywhere, and PCP puts some of the noise in S. Cells count as flagged when |S| is above three robust standard deviations (1.4826 × MAD) of S over the observed cells; that line is this tool's, not the paper's. Rows are ranked by the total |S| of all their cells.

Verified by tests in the source: the paper's Section 4.1 experiment (rank 0.05 n, 5% of cells corrupted to ±1, n = 100 and 150) is recovered to a relative error under 10⁻⁵ with the corrupted cells found exactly; a 60 × 40 case with missing cells matches TensorLy 0.10.0's robust_pca to 10⁻⁶ in every cell; and on this page's example the split's objective is at or below TensorLy's, with every cell within 30 MW of it (under 0.2% of a typical hour). Using the paper's faster growth factor, 1.5, the solver met its stopping test while still 0.04 from TensorLy on the 60 × 40 case, which is why this tool grows μ more slowly and reports the gap.

BibTeX

@article{candes2011robust,
  author  = {Cand{\`e}s, Emmanuel J. and Li, Xiaodong and Ma, Yi and Wright, John},
  title   = {Robust Principal Component Analysis?},
  journal = {Journal of the ACM},
  volume  = {58}, number = {3}, pages = {11:1--11:37}, year = {2011},
  doi     = {10.1145/1970392.1970395}
}
@techreport{lin2010augmented,
  author      = {Lin, Zhouchen and Chen, Minming and Ma, Yi},
  title       = {The Augmented {L}agrange Multiplier Method for Exact Recovery of Corrupted Low-Rank Matrices},
  institution = {University of Illinois at Urbana-Champaign},
  number      = {UILU-ENG-09-2215}, year = {2010},
  note        = {arXiv:1009.5055}
}
@article{hestenes1958inversion,
  author  = {Hestenes, Magnus R.},
  title   = {Inversion of Matrices by Biorthogonalization and Related Results},
  journal = {Journal of the Society for Industrial and Applied Mathematics},
  volume  = {6}, number = {1}, pages = {51--90}, year = {1958},
  doi     = {10.1137/0106005}
}

Limits

Questions

What does robust PCA do?

It splits a table into two tables that add back up to it. The low-rank part holds the few patterns that every row is a mix of, such as the shape of a weekday and of a weekend day. The sparse part holds the cells that no mix of those patterns explains: a spike, a sensor fault, a typing error, a day that behaved oddly for a few hours. Ordinary PCA lets one wild cell bend every pattern; robust PCA sets it aside.

How is this different from flagging values far from the column average?

A column average does not know about the row. A load of 20,000 MW at 2 pm is ordinary on a hot day and strange on a mild one. Robust PCA compares each cell with what its own row's mix of shared patterns predicts, so it flags 2 pm only when the rest of that day says it should have been lower.

Why are some flagged cells small?

Real tables are not exactly low rank plus sparse; they also carry small noise everywhere, and the method puts some of it in the sparse part. The tool draws a noise line at three robust standard deviations of the sparse part and counts only cells above it. The rows list ranks rows by the total size of their sparse cells, which is the more useful reading on noisy data.

What does the sensitivity setting change?

It multiplies the weight lambda on the sparse part. The default, 1, is the weight Candès and colleagues proved works for any table: one over the square root of the longer side. At 2 a cell must break the pattern by more before it is moved to the sparse part, so fewer cells are flagged and the low-rank part takes more; at 0.5 more cells are flagged.

What does certified within 0.01% mean?

The method solves a convex problem, so there is one best value of its objective. The solver's dual variable gives a lower bound on that best value and its split gives an upper bound. When the two are within 0.01% of each other the split is that close to optimal, whatever the data.

How should I lay out my data?

One row per thing that repeats (a day, a store, a patient) and one column per measurement that lines up across rows (an hour, a week, a test). Cells in the same column must mean the same thing. If you have one long series with a cycle, such as hourly readings, set the fold length to the cycle (24) and the tool lays it out as days by hours.

Is my data uploaded anywhere?

No. The file is read and split by JavaScript in this browser tab. There are no accounts, cookies or analytics vendors.

Example data: hourly load in megawatts of the American Electric Power (AEP) zone of PJM Interconnection for every day of 2017, one row per day and one column per hour ending (he01 is midnight to 1 am, he24 is 11 pm to midnight), from the Kaggle "Hourly Energy Consumption" extract of PJM data by Rob Mulla, released under CC0, retrieved for this repository in 2026. The extract skips the hour lost to daylight saving time on 12 March, which is left empty here, and repeats the hour gained on 5 November, of which the first reading is kept.