XLPack 6.1
Excel VBA Numerical Library Reference Manual
Loading...
Searching...
No Matches

◆ Zgecovy()

Sub Zgecovy ( Job As  Long,
N As  Long,
A() As  Complex,
Jpvt() As  Long,
Ci() As  Complex,
Info As  Long 
)

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,out]A()Array A(LA1 - 1, LA2 - 1) (LA1 >= N, LA2 >= 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,out]Jpvt()Array Jpvt(LJpvt - 1) (LJpvt >= N)
The pivot vector returned by Dgelsy.
[out]Ci()Array Ci(LCi - 1) (LCi >= N)
Job = -1: Not referenced.
Job = 0: The diagonal elements of C are returned (real numbers).
Job = i > 0: The i-th column of C is returned.
[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 A() is invalid.
= -4: The argument Jpvt() is invalid.
= -5: The argument Ci() is invalid.
= i > 0: Other error encountered.
Example Program
See example of Zgelsy.