MATLAB Function Reference    

Least squares solution in the presence of known covariance



x = lscov(A,b,V) returns the vector x that solves A*x = b + e where e is normally distributed with zero mean and covariance V. Matrix A must be m-by-n where m > n. This is the over-determined least squares problem with covariance V. The solution is found without inverting V.

[x,dx] = lscov(A,b,V) returns the standard errors of x in dx. The standard statistical formula for the standard error of the coefficients is:


The vector x minimizes the quantity (A*x-b)'*inv(V)*(A*x-b). The classical linear algebra solution to this problem is

but the lscov function instead computes the QR decomposition of A and then modifies Q by V.

See Also

lsqnonneg, qr

The arithmetic operator \


[1]  Strang, G., Introduction to Applied Mathematics, Wellesley-Cambridge, 1986, p. 398.

  ls lsqnonneg