# Changeset 202

Ignore:
Timestamp:
Nov 1, 2004, 4:00:41 PM (19 years ago)
Message:

Location:
trunk/src
Files:
3 edited

### Legend:

Unmodified
 r196 // $Id$ // Header #include "RegressionLinear.h" // C++_tools #include "Regression.h" #include "vector.h" RegressionLinear::RegressionLinear(void) : cov00_(0), cov01_(0), cov11_(0), k_(0), m_(0), sumsq_(0) : Regression(), cov00_(0), cov01_(0), cov11_(0), k_(0), m_(0), sumsq_(0) { }
 r196 // C++ tools include ///////////////////// #include "Regression.h" #include "vector.h" class RegressionLinear class RegressionLinear : public Regression { /// /// Copy Constructor. (not implemented) /// RegressionLinear(const RegressionLinear&); /// /// Destructor /// /// /// This function computes the best-fit linear regression /// coefficients (k,m) of the model  \f$y = kx + m \f$ from from /// coefficients (k,m) of the model  \f$y = kx + m \f$ from /// vectors \a x and \a y, by minimizing \f$\sum{(kx_i+m-x_i)^2} /// \f$. /// This function computes the best-fit linear regression /// coefficients (k,m) of the model \f$y = kx + m \f$ from from /// vectors \a x and \a y, by minimizing \f$\sum w_i(kx_i+m-x_i)^2 /// \f$. The weight \f$w_i \f$ is the inverse of the variance for /// \f$y_i \f$ /// vectors \a x and \a y, by minimizing \f$\sum /// w_i(kx_i+m-x_i)^2 \f$. /// inline int fit_weigted(gslapi::vector x, gslapi::vector y, gslapi::vector w) inline int fit_weighted(const gslapi::vector x, const gslapi::vector y, const gslapi::vector w) { return gsl_fit_wlinear_vector(x.gsl_vector_pointer(), w.gsl_vector_pointer(),