Your data
Empty cells are allowed; the tool fills them from the low-rank part.
Result
Where the table breaks its pattern
above what the row's pattern predicts below it. Each cell is the sparse part S; white is zero. Click a row to see it below.
One row: observed against the shared pattern
Rows that break the pattern most
| Row | Flagged cells | Net (flagged) | Total |S| |
|---|
Largest single cells
| Row | Column | Observed | Pattern predicts | Sparse part |
|---|
Empty cells, filled from the low-rank part
| Row | Column | Filled value |
|---|
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
- A flagged cell is unusual, not wrong. The sparse part says a cell does not fit the pattern its row shares with the others. It does not say why, or that the value is an error; check the source before you correct or drop anything.
- Whole-row shifts are not anomalies here. A day that is 10% lower in every hour is still a mix of the shared shapes, so it lands in the low-rank part. Robust PCA finds cells that break a row's own shape. To find rows whose level changed, use the isolation forest on the rows or the changepoint detector on a series.
- Columns must line up. Every cell in a column should mean the same thing (the same hour, the same week). Columns in different units need the robust scaling, or the largest numbers decide everything.
- The guarantee is for random corruption. The exact-recovery theorem assumes the corrupted cells fall in random places and the low-rank part is spread out (incoherent). A whole column of bad data, or a pattern that lives in one row only, can be split either way.
- Size. Up to 250,000 cells, with the shorter side at most 400, in the browser; each iteration runs a full SVD of the table.
- Not modelled: stable PCP with an explicit noise level (Zhou et al. 2010), time order within a row, more than two dimensions (tensors), and weights per cell.
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.