Linear Algebra & Matrices

Least Squares Solution Calculator

Find the exact full-column-rank least-squares solution and residual.

Linear Algebra & Matrices

Enter matrix values

Exact structural results; labelled numerical approximations where required
Matrix A
Right-hand side b

Use signed finite decimals. Fill every visible cell. Fractions, commas, and scientific notation are not accepted.

Linear algebra result

Enter valid values to see the result.

Your entries are calculated in this browser and are not submitted to 365CALCS.COM.

Quick guide

How to use this calculator

  1. Set the matrix dimensions required by the task.
  2. Fill every visible entry and any operation-specific control.
  3. Read the result type, factors, classification, and disclosed limitations.

Calculation method

Apply the stated linear-algebra contract

x̂ = (AᵀA)⁻¹Aᵀb

Undefined, singular, dimensionally incompatible, dependent, or unsupported inputs receive an explicit message instead of a fabricated numeric result.

Worked example

Example interpretation

The residual satisfies Aᵀ(Ax̂−b)=0.

x̂ = (AᵀA)⁻¹Aᵀb

Supported inputs

Precision and limits

Matrix size

Input matrices are limited to 1–6 rows and columns; operation-specific square, rank, or compatibility rules still apply.

Entry precision

Enter signed finite decimals with at most 30 digits and 15 decimal places.

Exactness

Finite decimals become reduced rational numbers and intermediate structural calculations are not rounded.

Supported scope

This contract requires full column rank; rank-deficient minimum-norm solutions belong to the pseudoinverse calculator.