{ } Raw JSON

bundles / scipy 1.17.1 / scipy / optimize / _lsq / trf_linear / regularized_lsq_with_qr

function

scipy.optimize._lsq.trf_linear:regularized_lsq_with_qr

source: /scipy/optimize/_lsq/trf_linear.py :18

Signature

def   regularized_lsq_with_qr ( m n R QTb perm diag copy_R = True )

Summary

Solve regularized least squares using information from QR-decomposition.

Extended Summary

The initial problem is to solve the following system in a least-squares sense

A x = b
D x = 0

where D is diagonal matrix. The method is based on QR decomposition of the form A P = Q R, where P is a column permutation matrix, Q is an orthogonal matrix and R is an upper triangular matrix.

Parameters

m, n : int

Initial shape of A.

R : ndarray, shape (n, n)

Upper triangular matrix from QR decomposition of A.

QTb : ndarray, shape (n,)

First n components of Q^T b.

perm : ndarray, shape (n,)

Array defining column permutation of A, such that ith column of P is perm[i]-th column of identity matrix.

diag : ndarray, shape (n,)

Array containing diagonal elements of D.

Returns

x : ndarray, shape (n,)

Found least-squares solution.

Aliases

  • scipy.optimize._lsq.trf_linear.regularized_lsq_with_qr