# Changeset 702 for trunk/yat/regression

Ignore:
Timestamp:
Oct 26, 2006, 4:04:35 PM (16 years ago)
Message:

Refs #81 moved mse_ to inherited classes and made mse() pure virtual because mse is calculated different for different classes and therefore this design is more logic. Fixed docs and other things...

Location:
trunk/yat/regression
Files:
11 edited

Unmodified
Removed
• ## trunk/yat/regression/Linear.h

 r697 inline Linear(void) : OneDimensional(), alpha_(0), alpha_var_(0), beta_(0), beta_var_(0), m_x_(0){} mse_(0), m_x_(0){} /// /// /// @brief Mean Squared Error /// inline double mse(void) const { return mse_; } /// /// @return value in @a x of model /// double beta_; double beta_var_; double mse_; double m_x_; // average of x values double r2_; // coefficient of determination
• ## trunk/yat/regression/LinearWeighted.cc

 r682 // product wx*wy, so we can send in w and a dummie to get what we // want. utility::vector dummie(w.size(),1); statistics::AveragerPairWeighted ap; ap.add_values(x,y,w,dummie); double m_x = ap.x_averager().mean(); double m_y = ap.y_averager().mean(); double sxy = ap.sum_xy_centered(); double sxx = ap.x_averager().sum_xx_centered(); double syy = ap.y_averager().sum_xx_centered(); ap_.reset(); ap_.add_values(x,y,utility::vector(x.size(),1),w); // estimating the noise level. see attached document for motivation // of the expression. s2_= (syy-sxy*sxy/sxx)/(w.sum()-2*(w*w)/w.sum()) ; s2_= (syy()-sxy()*sxy()/sxx())/(w.sum()-2*(w*w)/w.sum()) ; alpha_ = m_y; beta_ = sxy/sxx; alpha_var_ = ap.y_averager().standard_error() * ap.y_averager().standard_error(); beta_var_ = s2_/sxx; m_x_=m_x; alpha_ = m_y(); beta_ = sxy()/sxx(); alpha_var_ = ap_.y_averager().standard_error() * ap_.y_averager().standard_error(); beta_var_ = s2_/sxx(); m_x_=m_x(); }

• ## trunk/yat/regression/Polynomial.h

 r697 /// inline Polynomial(size_t power) : OneDimensional(), power_(power) {} : OneDimensional(), mse_(0), power_(power) {} /// /// /// @todo /// @brief Mean Squared Error /// inline double mse(void) const { return mse_; } /// /// @return value in @a x of model /// private: MultiDimensional md_; double mse_; size_t power_;
• ## trunk/yat/regression/PolynomialWeighted.h

 r682 /// inline PolynomialWeighted(size_t power) : OneDimensionalWeighted(), power_(power) {} : OneDimensionalWeighted(), mse_(0), power_(power) {} /// /// /// @todo /// @brief Mean Squared Error /// inline double mse(void) const { return mse_; } /// /// function predicting in one point. /// private: MultiDimensionalWeighted md_; double mse_; size_t power_;
Note: See TracChangeset for help on using the changeset viewer.