11#ifndef __Util_stat_LinearRegression_h
12#define __Util_stat_LinearRegression_h
23 float iterative_outlier_threshold = 0.0;
26 bool subtract_weighted_mean_abscissa =
false;
29 Estimate<double> scale;
32 Estimate<double> offset;
35 double covariance = 0.0;
38 double weighted_mean_abscissa = 0.0;
47 void ordinary_least_squares (
const std::vector<double>& yval,
48 const std::vector<double>& xval,
49 const std::vector<bool>* mask = 0);
53 void weighted_least_squares (
const std::vector<double>& yval,
54 const std::vector<double>& xval,
55 const std::vector<double>& weight);
62 void generalized_least_squares (
const std::vector<double>& yval,
63 const std::vector<double>& xval,
64 const std::vector<double>& weight,
65 const std::vector<double>& alpha);
68 void least_squares_worker (
const std::vector<double>& yval,
69 const std::vector<double>& xval,
70 const std::vector<double>& weight,
71 const std::vector<double>& alpha);
74 std::vector<double> masked_weights;
78 std::vector<double> residual;