Changeset 429 for trunk/lib/statistics/Naive.h
 Timestamp:
 Dec 8, 2005, 8:50:11 PM (18 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/lib/statistics/Naive.h
r389 r429 7 7 8 8 #include <c++_tools/gslapi/vector.h> 9 #include <c++_tools/statistics/Averager.h>10 #include <c++_tools/statistics/AveragerWeighted.h>11 9 12 10 #include <iostream> … … 51 49 52 50 /// 53 /// This function computes the bestfit for the naive model \f$ y54 /// = m \f$ from vectors \a x and \a y, by minimizing \f$ \sum55 /// w_i(y_im)^2 \f$. The weight \f$ w_i \f$ is proportional to56 /// the inverse of the variance for \f$ y_i \f$57 ///58 void fit(const gslapi::vector& x,59 const gslapi::vector& y,60 const gslapi::vector& w);61 62 ///63 51 /// Function predicting value using the naive model. \a y_err is 64 52 /// the expected deviation from the line for a new data point. The 65 /// weight for the new point can be specified. A smaller weight 66 /// means larger error. The error has two components: the variance 67 /// of point and error in estimation of m_. 53 /// error has two components: the variance of point and error in 54 /// estimation of the mean. 68 55 /// 69 void predict(const double x, double& y, double& y_err, 70 const double w=1) ; 56 void predict(const double x, double& y, double& y_err) ; 71 57 72 ///73 /// @return prediction value and parameters74 ///75 std::ostream& print(std::ostream&) const;76 77 58 /// 78 59 /// @return header for print()
Note: See TracChangeset
for help on using the changeset viewer.