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:
1. |
If and : find the least squares solution of an overdetermined system, i.e., solve the least squares problem
|
2. |
If and : find the minimum norm solution of an underdetermined system . |
3. |
If and : find the minimum norm solution of an undetermined system . |
4. |
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.
nag_dgels (f08aac) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
nag_dgels (f08aac) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
Users' Note for your implementation for any additional implementation-specific information.
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.