 |
OpenMS
3.0.0
|
|
Go to the documentation of this file.
47 template <
typename Real>
86 stand_dev_residuals_(0),
88 stand_error_slope_(0),
118 void computeRegression(
double confidence_interval_P,
119 std::vector<double>::const_iterator x_begin,
120 std::vector<double>::const_iterator x_end,
121 std::vector<double>::const_iterator y_begin,
122 bool compute_goodness =
true);
146 void computeRegressionWeighted(
double confidence_interval_P,
147 std::vector<double>::const_iterator x_begin,
148 std::vector<double>::const_iterator x_end,
149 std::vector<double>::const_iterator y_begin,
150 std::vector<double>::const_iterator w_begin,
151 bool compute_goodness =
true);
154 double getIntercept()
const;
156 double getSlope()
const;
158 double getXIntercept()
const;
160 double getLower()
const;
162 double getUpper()
const;
164 double getTValue()
const;
166 double getRSquared()
const;
168 double getStandDevRes()
const;
170 double getMeanRes()
const;
172 double getStandErrSlope()
const;
174 double getChiSquared()
const;
176 double getRSD()
const;
179 static inline double computePointY(
double x,
double slope,
double intercept)
181 return slope * x + intercept;
213 void computeGoodness_(
const std::vector<Wm5::Vector2d>& points,
double confidence_interval_P);
216 template <
typename Iterator>
220 template <
typename Iterator>
233 template <
typename Iterator>
236 double chi_squared = 0.0;
239 for (; xIter != x_end; ++xIter, ++yIter)
241 chi_squared += std::pow(*yIter -
computePointY(*xIter, slope, intercept), 2);
248 template <
typename Iterator>
251 double chi_squared = 0.0;
255 for (; xIter != x_end; ++xIter, ++yIter, ++wIter)
257 chi_squared += *wIter * std::pow(*yIter -
computePointY(*xIter, slope, intercept), 2);
double t_star_
The value of the t-statistic.
Definition: LinearRegression.h:197
double chi_squared_
The value of the Chi Squared statistic.
Definition: LinearRegression.h:207
double x_intercept_
The intercept of the fitted line with the x-axis.
Definition: LinearRegression.h:191
double computeChiSquare(Iterator x_begin, Iterator x_end, Iterator y_begin, double slope, double intercept)
Compute the chi squared of a linear fit.
Definition: LinearRegression.h:234
double mean_residuals_
Mean of residuals.
Definition: LinearRegression.h:203
static double computePointY(double x, double slope, double intercept)
given x compute y = slope * x + intercept
Definition: LinearRegression.h:179
double stand_error_slope_
The standard error of the slope.
Definition: LinearRegression.h:205
double computeWeightedChiSquare(Iterator x_begin, Iterator x_end, Iterator y_begin, Iterator w_begin, double slope, double intercept)
Compute the chi squared of a weighted linear fit.
Definition: LinearRegression.h:249
double r_squared_
The squared correlation coefficient (Pearson)
Definition: LinearRegression.h:199
double stand_dev_residuals_
The standard deviation of the residuals.
Definition: LinearRegression.h:201
double lower_
The lower bound of the confidence interval.
Definition: LinearRegression.h:193
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
This class offers functions to perform least-squares fits to a straight line model,...
Definition: LinearRegression.h:73
double intercept_
The intercept of the fitted line with the y-axis.
Definition: LinearRegression.h:187
Definition: LinearRegression.h:45
Definition: LinearRegression.h:48
LinearRegression()
Constructor.
Definition: LinearRegression.h:78
double slope_
The slope of the fitted line.
Definition: LinearRegression.h:189
double rsd_
the relative standard deviation
Definition: LinearRegression.h:209
Vector2< double > Vector2d
Definition: LinearRegression.h:48
double upper_
The upper bound of the confidence interval.
Definition: LinearRegression.h:195