Contact

MPSEUDOINVERSE Function (Gnumeric)

Math Beginner Gnumeric

Compute numerical matrix pseudoinverses in Gnumeric with MPSEUDOINVERSE, rectangular array output, relative thresholds and least-squares checks.

Verification status: Gnumeric 1.12.57 ssconvert: specified MPSEUDOINVERSE fixtures and separately captured worked-example GUI. Gnumeric 1.12.62 source inspected separately. How formula examples are checked

MPSEUDOINVERSE returns a numerical pseudoinverse of a matrix. Unlike an ordinary inverse, a pseudoinverse can be useful for rectangular matrices and rank-deficient models. It does not make an underdetermined problem uniquely identifiable; the result reflects a particular minimum-norm or least-squares construction and the numerical threshold used to discard small directions.

Syntax and result shape

=MPSEUDOINVERSE(matrix[,threshold])

matrix is required and must be a nonempty numeric matrix. threshold is optional: the function help describes it as a relative cutoff for discarding eigenvalues. The retained callback defaults it to 256 times Gnumeric’s floating-point epsilon. On the ordinary double-precision build that is approximately 5.684341886080802e-14. It is not an absolute cutoff measured in the same units as every input entry, nor a requested number of decimal places.

For an m-row by n-column input, the result has n rows and m columns. Select that full destination rectangle, type the formula and press Ctrl+Shift+Enter for Gnumeric array entry. Do not manually type braces. Exclude headings and use explicitly numeric cells; matrix positions must not shift because a label or missing value was included.

Worked example: a tall matrix

Enter this matrix in A1:B3:

Row A B
1 1 0
2 0 1
3 1 1

Select D1:F2 and array-enter =MPSEUDOINVERSE(A1:B3). The expected result is:

D E F
1 2/3 -1/3 1/3
2 -1/3 2/3 1/3

The cells contain numeric approximations such as 0.666666666666667, not literal fractional text. Independently, A has full column rank, so its pseudoinverse is (AᵀA)⁻¹Aᵀ. Here AᵀA is [[2,1],[1,2]], whose inverse is one-third of [[2,-1],[-1,2]]. Multiplying gives the displayed 2×3 result.

Select H1:I2 and array-enter =MMULT(D1:F2,A1:B3). The expected result is the 2×2 identity matrix. The opposite multiplication has shape 3×3 and is a projection, not the 3×3 identity. This distinction is important when checking rectangular matrices.

Advanced use: least-squares coefficients

Put observations 1, 2, 4 in K1:K3. Select M1:M2 and array-enter =MMULT(D1:F2,K1:K3). The expected fitted coefficients are 4/3 and 7/3. Their fitted observations are 4/3, 7/3 and 11/3. The residuals, observed minus fitted, are -1/3, -1/3 and 1/3; the residual sum of squares is 1/3.

This example cannot satisfy all three equations exactly, and the pseudoinverse does not pretend otherwise. Keep residuals visible. If you need an intercept in a regression design, include its column of ones explicitly rather than assuming matrix algebra adds one.

Threshold sensitivity and troubleshooting

A deliberately large threshold can suppress a numerically small direction and change the fitted model. For a separate 2×2 diagonal matrix [[1,0],[0,0.01]], the ordinary pseudoinverse is [[1,0],[0,100]]. Using threshold 0.1 suppresses the small direction in the tested fixture and returns [[1,0],[0,0]]. That is a substantive modeling change, not merely rounding 100 to fewer digits.

  • An empty matrix produces #VALUE! in the retained callback. A nonempty rectangular matrix is not automatically an error.
  • The function is not restricted to nonsingular square inputs. Do not substitute MINVERSE’s input conditions for this function’s contract.
  • Do not rely on undocumented behavior for negative, nonfinite or arbitrarily large thresholds. Choose a justified nonnegative relative cutoff and compare the result with the default.
  • Check A×A⁺×A against A when the retained directions are meant to reconstruct the original matrix. Small discrepancies are expected with floating arithmetic; deliberate truncation can produce larger differences.
  • If output is missing columns, verify the reversed dimensions and the array-entry range before changing the mathematics.

Version and evidence

Official NEWS identifies MPSEUDOINVERSE as added in Gnumeric 1.12.3. Syntax, shape and default cutoff were inspected in retained 1.12.62 source; no retirement or last functioning version is inferred. Gnumeric 1.12.57 ssconvert independently recalculated the full 2×3 worked result on 17 October 2026 in C.UTF-8. The least-squares example is checked by exact algebra, not a claimed separate native run. A separate worked-example GUI capture is documented below.

MINVERSE calculates an ordinary inverse, while MMULT and TRANSPOSE provide reconstruction checks.

Official sources

The same native 1.12.57 engine session also confirmed the diagonal threshold example: the omitted threshold returned diagonal entries 1 and 100; threshold 0.1 returned 1 and 0. This verifies those two choices, not arbitrary cutoff boundaries.

Native application screenshot

Gnumeric MPSEUDOINVERSE worked example with synthetic inputs, formula bar and calculated results

Gnumeric 1.12.57, captured 17 October 2026. Input A1:B3; pseudoinverse D1:F2 (reversed shape). The selected cell D1 shows the formula in the formula bar. Display precision is shorter than the independent reference values; integer cells may show a trailing decimal point. GUI locale was not independently recorded.