XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ zgecovy()

void zgecovy ( int  job,
int  n,
int  lda,
doublecomplex  a[],
int  ipiv[],
doublecomplex  ci[],
int  iwork[],
int *  info 
)

Unscaled covariance matrix of linear least squares problem solved by zgelsy

Purpose
This routine computes the unscaled covariance matrix of linear least squares problem solved by zgelsy.

The following least squares problem with m x n matrix A can be solved by zgelsy.
minimize ||A*x - b||
The n x n symmetric positive definite matrix C, the unscaled covariance matrix of the estimated parameters, is defined as below.
C = (A^H*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.
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]nThe order of the matrix A = rank of A (should not be rank deficient). (n >= 0) (if n = 0, returns without computation)
[in]ldaLeading dimension of the two dimensional array a[][]. (lda >= max(1, n))
[in,out]a[][]Array a[la][lda] (la >= n)
[in] The QR factorized matrix returned by zgelsy.
[out] job = -1: a[][] is overwritten by the upper triangle of C.
  job = 0: The upper triangle of a[][] is to be destroyed.
[in]ipiv[]Array ipiv[lipiv] (lipiv >= n)
The pivot vector returned by zgelsy.
[out]ci[]Array ci[lci] (lci >= 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.
[out]iwork[]Array iwork[liwork] (liwork >= n)
Work array.
[out]info= 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 lda had an illegal value (lda < max(1, n))
= i > 0: Other error encountered