This class offers functions to perform least-squares fits to a straight line model, \( Y(c,x) = c_0 + c_1 x \).
More...
#include <OpenMS/ML/REGRESSION/LinearRegressionWithoutIntercept.h>
|
| | LinearRegressionWithoutIntercept () |
| | Constructor.
|
| |
| void | addData (double x, double y) |
| | adds an observation (x,y) to the regression data set.
|
| |
| void | addData (std::vector< double > &x, std::vector< double > &y) |
| | adds observations (x,y) to the regression data set.
|
| |
| double | getSlope () const |
| | returns the slope of the estimated regression line.
|
| |
|
| double | sum_xx_ |
| | total variation in x
|
| |
| double | sum_xy_ |
| | sum of products
|
| |
| int | n_ |
| | number of observations
|
| |
This class offers functions to perform least-squares fits to a straight line model, \( Y(c,x) = c_0 + c_1 x \).
◆ LinearRegressionWithoutIntercept()
◆ addData() [1/2]
| void addData |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
adds an observation (x,y) to the regression data set.
- Parameters
-
| [in] | x | independent variable value |
| [in] | y | dependent variable value |
◆ addData() [2/2]
| void addData |
( |
std::vector< double > & |
x, |
|
|
std::vector< double > & |
y |
|
) |
| |
adds observations (x,y) to the regression data set.
- Parameters
-
| [in] | x | vector of independent variable values |
| [in] | y | vector of dependent variable values |
◆ getSlope()
| double getSlope |
( |
| ) |
const |
returns the slope of the estimated regression line.
◆ n_
◆ sum_xx_
◆ sum_xy_