nag_dgels (f08aac) solves linear least squares problems of the form
where
is an
by
real matrix of full rank, using a
or
factorization of
.
The following options are provided:
- If and : find the least squares solution of an overdetermined system, i.e., solve the least squares problem
- If and : find the minimum norm solution of an underdetermined system .
- If and : find the minimum norm solution of an undetermined system .
- If and : find the least squares solution of an overdetermined system, i.e., solve the least squares problem
Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999)
LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia
http://www.netlib.org/lapack/lug
- NE_ALLOC_FAIL
Dynamic memory allocation failed.
- NE_BAD_PARAM
On entry, argument had an illegal value.
- NE_FULL_RANK
Diagonal element of the triangular factor of is zero, so that does not have full rank; the least squares solution could not be computed.
- NE_INT
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_2
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
- NE_INT_3
On entry, , and .
Constraint: .
- NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
See Section 4.5 of
Anderson et al. (1999) for details of error bounds.
The complex analogue of this function is
nag_zgels (f08anc).
This example solves the linear least squares problem
where
The square root of the residual sum of squares is also output.