Changeset 730 for trunk/yat/regression/LinearWeighted.h
- Timestamp:
- Jan 6, 2007, 12:02:21 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/regression/LinearWeighted.h
r729 r730 27 27 #include "OneDimensionalWeighted.h" 28 28 29 #include <cmath>30 31 29 namespace theplu { 32 30 namespace yat { … … 55 53 virtual ~LinearWeighted(void); 56 54 57 /// 58 /// @return the parameter \f$ \alpha \f$ 59 /// 55 /** 56 \f$ alpha \f$ is estimated as \f$ \frac{\sum w_iy_i}{\sum w_i} \f$ 57 58 @return the parameter \f$ \alpha \f$ 59 */ 60 60 double alpha(void) const; 61 61 62 /// 63 /// @return standard deviation of parameter \f$ \alpha \f$ 64 /// 62 /** 63 Variance is estimated as \f$ \frac{s^2}{\sum w_i} \f$ 64 65 @see s2() 66 67 @return variance of parameter \f$ \alpha \f$ 68 */ 65 69 double alpha_var(void) const; 66 70 67 /// 68 /// @return the parameter \f$ \beta \f$ 69 /// 71 /** 72 \f$ beta \f$ is estimated as \f$ \frac{\sum 73 w_i(y_i-m_y)(x_i-m_x)}{\sum w_i(x_i-m_x)^2} \f$ 74 75 @return the parameter \f$ \beta \f$ 76 */ 70 77 double beta(void) const; 71 78 72 /// 73 /// @return standard deviation of parameter \f$ \beta \f$ 74 /// 79 /** 80 Variance is estimated as \f$ \frac{s^2}{\sum w_i(x_i-m_x)^2} \f$ 81 82 @see s2() 83 84 @return variance of parameter \f$ \beta \f$ 85 */ 75 86 double beta_var(void) const; 76 87 … … 91 102 /// \f$ y =\alpha + \beta (x - m) \f$ 92 103 /// 93 double predict(const double x) const { return alpha_ + beta_ * (x-m_x_); } 94 95 /// 96 /// estimated squared deviation from predicted value for a new 97 /// data point in @a x with weight @a w 98 /// 99 double prediction_error2(const double x, const double w=1) const; 104 double predict(const double x) const; 100 105 101 106 /** … … 126 131 double beta_; 127 132 double beta_var_; 128 double m_x_; // average of x values129 double r2_; // coefficient of determination130 double s2_;131 double mse_;132 133 }; 133 134
Note: See TracChangeset
for help on using the changeset viewer.