# Changeset 428

Ignore:
Timestamp:
Dec 8, 2005, 5:20:36 PM (17 years ago)
Message:

improved doc in Score

Location:
trunk/lib/statistics
Files:
4 edited

Unmodified
Removed
• ## trunk/lib/statistics/Linear.cc

 r385 } void Linear::fit(const gslapi::vector& x, const gslapi::vector& y, const gslapi::vector& w) { double m_x = w*x /w.sum(); double m_y = w*y /w.sum(); double sxy = 0; for (size_t i=0; i
• ## trunk/lib/statistics/Linear.h

 r420 /// /// This function computes the best-fit linear regression /// coefficients \f$(\alpha, \beta)\f$ of the model \f$y = /// \alpha + \beta (x-m_x) \f$ from vectors \a x and \a y, by /// minimizing \f$\sum{w_i(y_i - \alpha - \beta (x-m_x))^2} \f$, /// where \f$m_x \f$ is the weighted average. By construction \f$/// \alpha \f$ and \f$\beta \f$ are independent. /// Function predicting value using the linear model. \a y_err is /// the expected deviation from the line for a new data point. /// void fit(const gslapi::vector& x, const gslapi::vector& y, const gslapi::vector& w); /// /// Function predicting value using the linear model. \a y_err is /// the expected deviation from the line for a new data point. If /// weights are used a weight can be specified for the new point. /// inline void predict(const double x, double& y, double& y_err, const double w=1.0) { y = alpha_ + beta_ * (x-m_x_); y_err = sqrt( alpha_var_+beta_var_*(x-m_x_)*(x-m_x_)+s2_/w ); x_=x; y_=y; y_err_=y_err; } void predict(const double x, double& y, double& y_err) ///
• ## trunk/lib/statistics/OneDimensional.h

 r389 /// x for predicted point /// double x_; //double x_; /// /// y for predicted point /// double y_; //double y_; /// /// estimated error of predicted point (in y). /// double y_err_; //double y_err_; };
• ## trunk/lib/statistics/Score.h

 r410 namespace statistics { /// /// /// Abstract Base Class defining the interface for the score classes. /// class Score { public: /// ///   Constructor /// Score(bool absolute=true) ; /// class Score { public: /// ///   Constructor /// Score(bool absolute=true) ; /// ///   Destructor /// virtual ~Score(void) {}; ///   Destructor /// virtual ~Score(void) {}; /// /// ///  Function changing mode of Score /// /// @return statistica. /// /// @param target is +1 or -1 /// @param target vector of targets (most often +1 -1) /// @param value vector of the values /// @train_set defining which values to use (number of values used
Note: See TracChangeset for help on using the changeset viewer.