You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multiple linear regression (two or more regressors) with singular-design detection #5
Methods determine model parameters by a multiple linear regression: one value fitted against two (or more) regressors plus a constant term, y = c0 + c1·x1 + c2·x2. least_squares.hpp has only the straight line, so this has to live outside the library, untraced, with its outputs entered into the formulas as if they were measurements.
The dimension of each coefficient derived from the value and the regressor it multiplies, as slope is today.
A singular design is an error, not a number. If a regressor is constant, or two are collinear, the normal equations are singular. Spreadsheet solvers answer with arbitrary coefficients in this case. The operation should return DomainError, so the method can say why no parameters were determined.
Problem
Methods determine model parameters by a multiple linear regression: one value fitted against two (or more) regressors plus a constant term,
y = c0 + c1·x1 + c2·x2.least_squares.hpphas only the straight line, so this has to live outside the library, untraced, with its outputs entered into the formulas as if they were measurements.Wanted
formula::multiple_least_squares, over runtime-length samples (see Least squares over runtime-length samples, in double, with R² #4), with outputs for the constant term, each coefficient and the coefficient of determination.slopeis today.DomainError, so the method can say why no parameters were determined.double(see Numeric headroom: 64-bit Rational overflows on realistic lab statistics — 128-bit intermediates or a wider representation? #1 for the exact path's headroom).Open points