# `optimize._lsq.trf_linear`¶

The adaptation of Trust Region Reflective algorithm for a linear least-squares problem.

## Module Contents¶

### Functions¶

 `regularized_lsq_with_qr`(m,n,R,QTb,perm,diag,copy_R=True) Solve regularized least squares using information from QR-decomposition. `backtracking`(A,g,x,p,theta,p_dot_g,lb,ub) Find an appropriate step size using backtracking line search. `select_step`(x,A_h,g_h,c_h,p,p_h,d,lb,ub,theta) Select the best step according to Trust Region Reflective algorithm. `trf_linear`(A,b,x_lsq,lb,ub,tol,lsq_solver,lsmr_tol,max_iter,verbose)
`regularized_lsq_with_qr`(m, n, R, QTb, perm, diag, copy_R=True)

Solve regularized least squares using information from QR-decomposition.

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.

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 i-th column of P is perm[i]-th column of identity matrix.
diag : ndarray, shape (n,)
Array containing diagonal elements of D.
x : ndarray, shape (n,)
Found least-squares solution.
`backtracking`(A, g, x, p, theta, p_dot_g, lb, ub)

Find an appropriate step size using backtracking line search.

`select_step`(x, A_h, g_h, c_h, p, p_h, d, lb, ub, theta)

Select the best step according to Trust Region Reflective algorithm.

`trf_linear`(A, b, x_lsq, lb, ub, tol, lsq_solver, lsmr_tol, max_iter, verbose)