Ignore:
Timestamp:
Dec 8, 2005, 8:50:11 PM (18 years ago)
Author:
Peter
Message:

separating weighted and non-weighted regression to different classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/statistics/Naive.h

    r389 r429  
    77
    88#include <c++_tools/gslapi/vector.h>
    9 #include <c++_tools/statistics/Averager.h>
    10 #include <c++_tools/statistics/AveragerWeighted.h>
    119
    1210#include <iostream>
     
    5149
    5250    ///
    53     /// This function computes the best-fit for the naive model \f$ y
    54     /// = m \f$ from vectors \a x and \a y, by minimizing \f$ \sum
    55     /// w_i(y_i-m)^2 \f$. The weight \f$ w_i \f$ is proportional to
    56     /// 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     ///
    6351    /// Function predicting value using the naive model. \a y_err is
    6452    /// 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.
    6855    ///
    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) ;
    7157
    72     ///
    73     /// @return prediction value and parameters
    74     ///
    75     std::ostream& print(std::ostream&) const;
    76              
    7758    ///
    7859    /// @return header for print()
Note: See TracChangeset for help on using the changeset viewer.