|
|
◆ dgecov()
| def dgecov |
( |
job |
, |
|
|
n |
, |
|
|
a |
, |
|
|
ci |
|
|
) |
| |
Unscaled covariance matrix of linear least squares problem solved by dgels
- Purpose
- dgecov computes the unscaled covariance matrix of linear least squares problem solved by dgels.
The following least squares problem with m x n matrix A can be solved by dgels if rank(A) = n. The n x n symmetric positive definite matrix C, the unscaled covariance matrix of the estimated parameters, is defined as below. C = (A^T*A)^(-1), rank(A) = n
The scalar multiple (sigma^2)*C has a statiscal interpretation of being an estimate of the variance-covariance matrix for the solution vector of the least squares problem. The scalar factor sigma^2 is expressed as follows. sigma^2 = ||A*x - b||^2 / (m - n)
where x is the least squares solution. The diagonal elements of (sigma^2)*C give the variance of each component of x.
- Returns
- info (int)
= 0: Successful exit
= -1: The argument job had an illegal value (job < -1 or job > n)
= -2: The argument n had an illegal value (n < 0)
= -3: The argument a is invalid.
= -4: The argument ci is invalid.
= i > 0: Other error encountered
- Parameters
-
| [in] | job | = -1: The upper triangle of C is computed.
= 0: The diagonal elements of C are computed.
= i > 0: i-th column of C is computed. (i <= n) |
| [in] | n | The order of the matrix A = rank of A. (should not be rank deficient). (n >= 0) (If n = 0, returns without computation) |
| [in,out] | a | Numpy ndarray (2-dimensional, float, n x n)
[in] The QR factorized matrix returned by dgels.
[out] job = -1: a[][] is overwritten by the upper triangle of C.
job = 0: The upper triangle of a[][] is to be destroyed. |
| [out] | ci | Numpy ndarray (1-dimensional, float, n)
job = -1: Not referenced.
job = 0: The diagonal elements of C are returned.
job = i > 0: The i-th column of C is returned. |
- Example Program
- See example of dgels.
|