weightedNormalEquations
Assemble weighted normal equations.
Developer documentation: this item describes internal implementation details.
Declaration
[normalMatrix,rhs] = weightedNormalEquations(X,x,W)
Parameters
Xdesign matrixxobserved valuesWweight matrix, vector, scalar, or decomposition
Returns
normalMatrixweighted normal-equation matrixrhsweighted normal-equation right-hand side
Discussion
For the weighted least-squares problem
\[\min_{\xi}\ (x - X\xi)^T W (x - X\xi),\]this helper returns the normal matrix and right-hand side
\[N = X^T W X, \qquad r = X^T W x.\]W may be a dense matrix, a diagonal weight vector, a scalar, or a MATLAB decomposition object representing a correlated observation covariance solve.