[libkorigin Index] [libkorigin Heirarchy]
Fitter for Linear Regression More...
#include </home/mh/korigin/korigin/doc/tmp/linreg.h>
Inherits: Fitter
Fitter for Linear Regression.
An example for a concrete fitter. Though mathematically simple, this is used as a test case for the fitting model draft.
Mathematically, it computes:
S1 = sum xi * yi
S2 = sum xi
S3 = sum yi
S4 = sum x^2
slope = (n * s1 - s2 * s3) / (n * s4 - s2 * s2);
intercept = (s3 - slope * s2) / n;
Constructor. Initializes slope and intercept to zero.
Returns the name of the fitter "Linear Regression".
Currently does nothing.
Returns the number of input columns, 2. Since linear regression requires 2 input columns, namely "x" and "y", this function returns 2. O wonder.
Returns the number of output columns, 1. The linear regression fitter generates truely linear y's for each "x" input.
Returns the name of ith input column. For i=0, returns "X". For i=1, returns "Y".
Returns the name of the output column, "Y linear". Does so for i=0. For all other values of i, it insults the caller.
Does the actual fit. In this function, the linear regression is actually computed, and the output column is filled.
Currently does nothing.
Currently does nothing.
| Kdoc |