solve_rank_deficiency

sofia_redux.toolkit.splines.spline_utils.solve_rank_deficiency(amat, beta, n_coefficients, bandwidth, tolerance)[source]

Solve a rank-deficient row-echelon reduced form matrix.

Parameters:
amatnumpy.ndarray (float)

The ‘A’ in the system Ax = B of shape (>=n_coefficients, >=bandwidth).

betanumpy.ndarray (float)

The ‘B’ in the system Ax = B of shape (>=n_coefficients,).

n_coefficientsint

The number of coefficients to solve for.

bandwidthint

The bandwidth of matrix A (amat).

tolerancefloat

The value over which the zeroth element of amat will be considered rank deficient. Deficient rows will be rotated into a new reduced rank matrix and solved accordingly.

Returns:
coefficients, ssr, ranknumpy.ndarray (float), float, int

The coefficients of shape (n_coefficients.), the sum of the squared residuals (ssr), and the rank.