# Changeset 730 for trunk/yat/regression/LinearWeighted.h

Ignore:
Timestamp:
Jan 6, 2007, 12:02:21 PM (16 years ago)
Message:

fixes #167 and #160

File:
1 edited

### Legend:

Unmodified
 r729 #include "OneDimensionalWeighted.h" #include namespace theplu { namespace yat { virtual ~LinearWeighted(void); /// /// @return the parameter \f$\alpha \f$ /// /** \f$alpha \f$ is estimated as \f$\frac{\sum w_iy_i}{\sum w_i} \f$ @return the parameter \f$\alpha \f$ */ double alpha(void) const; /// /// @return standard deviation of parameter \f$\alpha \f$ /// /** Variance is estimated as \f$\frac{s^2}{\sum w_i} \f$ @see s2() @return variance of parameter \f$\alpha \f$ */ double alpha_var(void) const; /// /// @return the parameter \f$\beta \f$ /// /** \f$beta \f$ is estimated as \f$\frac{\sum w_i(y_i-m_y)(x_i-m_x)}{\sum w_i(x_i-m_x)^2} \f$ @return the parameter \f$\beta \f$ */ double beta(void) const; /// /// @return standard deviation of parameter \f$\beta \f$ /// /** Variance is estimated as \f$\frac{s^2}{\sum w_i(x_i-m_x)^2} \f$ @see s2() @return variance of parameter \f$\beta \f$ */ double beta_var(void) const; /// \f$y =\alpha + \beta (x - m) \f$ /// double predict(const double x) const { return alpha_ + beta_ * (x-m_x_); } /// /// estimated squared deviation from predicted value for a new /// data point in @a x with weight @a w /// double prediction_error2(const double x, const double w=1) const; double predict(const double x) const; /** double beta_; double beta_var_; double m_x_; // average of x values double r2_; // coefficient of determination double s2_; double mse_; };