Stats Regression gls - CyrilB1531/lodestar GitHub Wiki

HomeStats-Regression

Generalized least squares — Lodestar.Stats.Regression

One entry point, for a linear model whose errors are correlated. GeneralizedLeastSquares.Fit fits a linear model under an error covariance the caller supplies and returns the same OlsSummary an ordinary fit does, at statsmodels.api.GLS parity.

For errors that are correlated, not only unequal: neighbouring readings in time or space, repeated measurements of one unit. The rows are whitened by the inverse of the covariance's Cholesky factor and fitted as ordinary least squares would. A covariance that is diagonal is weighted least squares with weights 1/σ, which is also how statsmodels' vector sigma maps here.

Why this exists

MathNet.Numerics 5.0.0 exports no generalized least squares at all, and its weighted regression returns the coefficients only — the reading decisions/0003 recorded. Decision 0004 put GLS after the weighted fit and the GLM families.

Types

Type What it is
GeneralizedLeastSquares Fits the model under a given error covariance and builds the table.

The summary, the options and the covariance of the estimates are OlsSummary, OlsOptions and CovarianceType.

See also