General (Gauss-Markov) Linear Model¶
The following routines implement solvers for dense and sparse-direct instances of the General Linear Model,
Dense algorithm¶
For dense instances of the problem, where \(A\) is \(m \times n\) and \(B\) is \(m \times p\), we assume that \(n \le m \le n+p\) as well as that \(A\) has full column rank, \(n\), and \(\begin{pmatrix} A & B \end{pmatrix}\) has full row rank, \(m\).
A Generalized QR factorization of (A,B),
where \(Q\) and \(Z\) are unitary and \(R\) and \(T\) are upper-trapezoidal, allows us to re-express the constraint as
which is re-written as
Since \(\| c \|_2 = \| Z y \|_2 = \| y \|_2\) is to be minimized, and \(c_2\) is fixed, our only freedom is in the choice of \(c_1\), which we set to zero. Then all that is left is to solve
for \(x\). Note that essentially the same scheme is used in LAPACK’s {S,D,C,Z}GGGLM.
Sparse-direct algorithm¶
For sparse instances of the GLM problem, the symmetric quasi-semidefinite augmented system
is formed, equilibrated, and then a priori regularization is added in order to make the system sufficiently quasi-definite. A Cholesky-like factorization of this regularized system is then used as a preconditioner for FGMRES(k).
C++ API¶
-
void
GLM
(const AbstractDistMatrix<F> &A, const AbstractDistMatrix<F> &B, const AbstractDistMatrix<F> &D, AbstractDistMatrix<F> &X, AbstractDistMatrix<F> &Y)¶
-
void
GLM
(const SparseMatrix<F> &A, const SparseMatrix<F> &B, const Matrix<F> &D, Matrix<F> &X, Matrix<F> &Y, const LeastSquaresCtrl<Base<F>> &ctrl = LeastSquaresCtrl<Base<F>>())¶
-
void
GLM
(const DistSparseMatrix<F> &A, const DistSparseMatrix<F> &B, const DistMultiVec<F> &D, DistMultiVec<F> &X, DistMultiVec<F> &Y, const LeastSquaresCtrl<Base<F>> &ctrl = LeastSquaresCtrl<Base<F>>())¶
Dense versions which overwrite their input¶
-
void
glm
::
Overwrite
(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &B, AbstractDistMatrix<F> &D, AbstractDistMatrix<F> &Y)¶
C API¶
Standard interface¶
Single-precision¶
-
ElError
ElGLM_s
(ElConstMatrix_s A, ElConstMatrix_s B, ElConstMatrix_s D, ElMatrix_s X, ElMatrix_s Y)¶
-
ElError
ElGLMDist_s
(ElConstDistMatrix_s A, ElConstDistMatrix_s B, ElConstDistMatrix_s D, ElDistMatrix_s X, ElDistMatrix_s Y)¶
Double-precision¶
-
ElError
ElGLM_d
(ElConstMatrix_d A, ElConstMatrix_d B, ElConstMatrix_d D, ElMatrix_d X, ElMatrix_d Y)¶
-
ElError
ElGLMDist_d
(ElConstDistMatrix_d A, ElConstDistMatrix_d B, ElConstDistMatrix_d D, ElDistMatrix_d X, ElDistMatrix_d Y)¶
Single-precision complex¶
-
ElError
ElGLM_c
(ElConstMatrix_c A, ElConstMatrix_c B, ElConstMatrix_c D, ElMatrix_c X, ElMatrix_c Y)¶
-
ElError
ElGLMDist_c
(ElConstDistMatrix_c A, ElConstDistMatrix_c B, ElConstDistMatrix_c D, ElDistMatrix_c X, ElDistMatrix_c Y)¶
Double-precision complex¶
-
ElError
ElGLM_z
(ElConstMatrix_z A, ElConstMatrix_z B, ElConstMatrix_z D, ElMatrix_z X, ElMatrix_z Y)¶
-
ElError
ElGLMDist_z
(ElConstDistMatrix_z A, ElConstDistMatrix_z B, ElConstDistMatrix_z D, ElDistMatrix_z X, ElDistMatrix_z Y)¶