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

◆ Zgecovs()

Sub Zgecovs ( Job As  Long,
N As  Long,
A() As  Complex,
S() As  Double,
Ci() As  Complex,
Info As  Long 
)

Unscaled covariance matrix of linear least squares problem solved by Zgelss

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

The following least squares problem with m x n matrix A can be solved by Zgelss.
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 lower 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 right singular vectors returned by Zgelss.
[out] Job = -1: A() is overwritten by the lower triangule of C. The strictly upper triangle part of A() is destroyed.
[in]S()Array S(LS - 1) (LS >= N)
Singular values computed by Zgelss.
[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 S() is invalid.
= -5: The argument Ci() is invalid.
Example Program
See example of Zgelss.