Advanced maths

Nuclear norm matrix completion calculator with observed entries

Fit a small matrix with missing entries using a nuclear-norm penalty and an explicit observation mask.

Your numbers

Rows separated by semicolons; values by commas.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Fit a small matrix with missing entries using a nuclear-norm penalty and an explicit observation mask. The solver returns the regularized fitted matrix, objective and residual checks. It does not claim that missing values are uniquely recoverable or that observed entries must be reproduced exactly under a positive penalty.

THE FORMULAmin_X 0.5 Σ_observed (X_ij−Y_ij)²+lambda ||X||_*.

A worked example

With only the two diagonal entries 1 observed in a 2-by-2 matrix and lambda 1/2, the fitted matrix diag(1/2,1/2) has observed SSE 1/2 and nuclear norm 1. The regularized objective is (1/2)(1/2) + (1/2)(1) = 3/4. The fit deliberately shrinks observed values.

Good to know

≤8×8observed/missing matrix; proximal singular-value thresholding with positive penalty. Regularized fit need not interpolate; no unique true completion guarantee or rank chosen in advance.

Separate unobserved entries from numeric zero

A question mark marks a missing entry. An entered zero is an actual observed value and contributes to the loss. Treating missing entries as observed zeros would impose extra data and can fundamentally change the completed matrix.

Rows must have equal length and at least one observed value must be present. The form supports at most eight by eight entries. It does not infer an observation mechanism or decide whether missingness is informative; those assumptions belong to the data problem outside the numeric mask.

Nuclear regularization shrinks the observed unit diagonalObserved: [1,?;?,1]Fit: [1/2,0;0,1/2]SSE/2=1/4; lambda×nuclear norm=1/2lambda=1/2 → objective 3/4
With only the two diagonal entries 1 observed in a 2-by-2 matrix and lambda 1/2, the fitted matrix diag(1/2,1/2) has observed SSE 1/2 and nuclear norm 1. The regularized objective is (1/2)(1/2) + (1/2)(1) = 3/4. The fit deliberately shrinks observed values. Diagram is schematic; labels specify the numerical values.

The Real 2×2 singular value decomposition calculator decomposes a completely observed small matrix. Regularized completion shrinks singular values while fitting only observed entries, and need not recover a unique unknown original matrix.

Read the convex objective

The loss is one half of the squared residual sum over observed entries plus lambda times the nuclear norm of X. Nuclear norm is the sum of singular values and encourages low-rank structure. Lambda must be positive and is not the desired rank itself.

Because this is penalized fitting, the best matrix can deliberately differ from observed values. Exact interpolation is a different constrained problem. Increasing lambda generally shrinks singular values more strongly, but it does not guarantee a particular numerical rank or a scientifically correct latent dimension.

Understand the proximal update

The gradient step replaces observed entries with their data values while retaining current missing entries, under the chosen unit step. Singular-value soft thresholding then subtracts lambda from each singular value and clips at zero. Repeating this operation solves the stated convex regularized problem within the numerical convergence criterion.

The implementation obtains singular values from a small symmetric Gram eigensystem. That is a bounded dense calculation, not a scalable sparse completion package. A convergence error is reported if the iteration cap is reached; the last intermediate matrix is not silently labeled a completed fit.

Verify the diagonal-observation example

The default matrix observes ones on the diagonal and leaves off-diagonals missing. With lambda one half, a diagonal fitted matrix with entries one half has observed squared residual sum one half and nuclear norm one. Its objective is one quarter plus one half, equal to three quarters.

This example also exposes nonidentifiability: some alternative matrices can attain the same penalized objective while assigning different missing entries. The returned zero off-diagonals follow the selected iteration from its initial state, not evidence that the unknown true off-diagonals were measured to be zero.

Read numerical rank with its threshold

The fitted rank counts singular values above a relative numerical threshold. A tiny positive value can be treated as zero for reporting even though floating-point arithmetic did not produce an exact symbolic zero. Rank is consequently labeled numerical, unlike an exact rational matrix-rank result elsewhere on the site.

The objective and observed SSE describe fit to the entered observations, not performance on missing ground truth. If withheld known entries are used for validation, their errors must be evaluated separately without entering them as training observations. The page does not automatically split or cross-validate the mask.

Recognize when recovery is underdetermined

Low rank alone does not identify every partially observed matrix. Entire missing rows or columns, disconnected observation patterns and insufficient diversity can leave many compatible completions. A stable iteration can still select one arbitrary member of a broad acceptable family.

Recovery theorems impose assumptions on rank, sampling and matrix structure that are not checked here. The calculator does not certify incoherence conditions or estimate the chance that those assumptions hold. Report a regularized completion as a model-based fit rather than a reconstruction proven equal to an unseen true matrix.

Choose scale and penalty deliberately

Multiplying observed values by a constant changes the balance between squared loss and the linear nuclear-norm penalty unless lambda is scaled consistently. The numeric penalty therefore has units related to the data magnitude and should not be copied blindly between differently scaled datasets.

The form does not normalize columns or handle heteroscedastic observation weights automatically. A matrix of mixed incomparable units may need a justified preprocessing model. Keep the mask, lambda, scaling and convergence information with the fitted entries so that a later user can reproduce the exact regularization question.

A few questions, answered

Does ? mean an observed zero?

No. It means unobserved and contributes no direct residual term.

Will all observed entries be matched exactly?

Not generally. The positive nuclear-norm penalty trades residual fit against low-rank structure.

Is the returned completion uniquely determined?

Not necessarily. Multiple matrices can attain the same objective, especially with weak observation patterns.

Does lambda specify the rank?

No. It is a penalty strength; numerical rank is an outcome under a reporting threshold.

Find your calculator

Start typing to explore the library.