ExtLib

QLinreg Class Reference

This Class offers a linear regression.

#include <QLinreg.h>

Public Functions




Detaild Description

Theory can be found here: http://en.wikipedia.org/wiki/Linear_regression

The Points given by the x and y values are subjected to a linear regression. The found linear equation is then y = mx + n. The regression coefficient r is a indicator of the accuracy of the linearity assumption: r = 1 means all points are exactly points of this line, r=0 means the points form a circular cloud of points.

(
Theorie findet man unter:   http://de.wikipedia.org/wiki/Lineare_Regression

Die Punkte x,y werden einer linearen Regression unterzogen, dabei vermutet man einen linearen Zusammenhang. Die gefundene Geradengleichung lautet dann  y = mx+n. Der Regressionskoeffizient r ist ein Maß für die Richtigkeit der Linearitätsvermutung: r=1 alle Punkte liegen exakt auf der Geraden, r=0 die Punkte liegen eher in einer kreisförmigen Punktwolke.
)

QLinreg::QLinreg (double *x, double *y, int count)

Constructs a Linreg from double x and y values.
Examlpe:
double x[6] = {20,16,15,16,13,10};
double y[6] = {0,3,7,4,6,10};
QLinreg l(x,y,6);

QLinreg::QLinreg (int *x, int *y, int count)

Constructs a Linreg from integer x and y values.
Examlpe:
int x[6] = {20,16,15,16,13,10};
int y[6] = {0,3,7,4,6,10};
QLinreg l(x,y,6);

double QLinreg::m()


Returns the slope of the line.  (Liefert die Steigung der Geraden.)

double QLinreg::n()

Returns the intersection with the Y-axis (Liefert den Schnittpunkt mit der Y-Achse.)
Example:
double X = 12;
double Y = X*l.n() + l.m();

double QLinreg::r()

Returns the regression coefficients. (Liefert den Regressionskoeffizienten.)

double QLinreg::meanx()


Returns the average of the x-values. (Liefert den Mittelwert der x-Reihe.)

double QLinreg::meany()


Returns the average of the y-values. (Liefert den Mittelwert der y-Reihe.)