50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

ouch (version 2.20)

glssoln: Generalized least-squares solver

Description

Solves the generalized least squares problem.

Usage

glssoln(a, x, v, tol = sqrt(.Machine$double.eps))

Arguments

Value

glssoln returns a list of two named components:

  • coeff is y as above.

  • residuals is e as above.

Details

Given matrices a, x, v, glssoln computes y such that (xay)Tv1(xay) is minimized. This is accomplished by first computing the Choleski decomposition of v: v=LLT. One then solves for y in the equation L1ay=L1x. This is accomplished by means of a singular-value decomposition of L1a.

The resulting y then satisfies x=ay+e, where the entries of e are the residuals.