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

fixes #167 and #160

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/regression/LinearWeighted.h

    r729 r730  
    2727#include "OneDimensionalWeighted.h"
    2828
    29 #include <cmath>
    30 
    3129namespace theplu {
    3230namespace yat {
     
    5553    virtual ~LinearWeighted(void);
    5654         
    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    */
    6060    double alpha(void) const;
    6161
    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    */
    6569    double alpha_var(void) const;
    6670
    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    */
    7077    double beta(void) const;
    7178
    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    */
    7586    double beta_var(void) const;
    7687   
     
    91102    /// \f$ y =\alpha + \beta (x - m) \f$
    92103    ///
    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;
    100105
    101106    /**
     
    126131    double beta_;
    127132    double beta_var_;
    128     double m_x_; // average of x values
    129     double r2_; // coefficient of determination
    130     double s2_;
    131     double mse_;
    132133  };
    133134
Note: See TracChangeset for help on using the changeset viewer.