Compute a generalized linear least squares fit.
Estimate x under the model b = Ax + w, where the noise w is assumed to follow a normal distribution with covariance matrix {\sigma^2} V.
If the size of the coefficient matrix A is n-by-p, the size of the vector/array of constant terms b must be n-by-k.
The optional input argument V may be a n-by-1 vector of positive weights (inverse variances), or a n-by-n symmetric positive semidefinite matrix representing the covariance of b. If V is not supplied, the ordinary least squares solution is returned.
The alg input argument, a guidance on solution method to use, is currently ignored.
Besides the least-squares estimate matrix x (p-by-k), the function also returns stdx (p-by-k), the error standard deviation of estimated x; mse (k-by-1), the estimated data error covariance scale factors (\sigma^2); and S (p-by-p, or p-by-p-by-k if k > 1), the error covariance of x.
Reference: Golub and Van Loan (1996), Matrix Computations (3rd Ed.), Johns Hopkins, Section 5.6.3
See also: ols, gls, lsqnonneg.
Package: octave