source: trunk/lib/statistics/OneDimensional.h @ 429

Last change on this file since 429 was 429, checked in by Peter, 16 years ago

separating weighted and non-weighted regression to different classes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
Line 
1// $Id: OneDimensional.h 429 2005-12-08 19:50:11Z peter $
2
3#ifndef _theplu_statistics_regression_onedimensioanl_
4#define _theplu_statistics_regression_onedimensioanl_
5
6#include <c++_tools/statistics/AveragerPair.h>
7
8#include <ostream>
9
10namespace theplu {
11namespace gslapi {
12  class vector;
13}
14
15namespace statistics {
16namespace regression {
17 
18  ///
19  /// Abstract Base Class for One Dimensional fitting.   
20  ///
21  /// @todo document
22  ///
23  class OneDimensional
24  {
25 
26  public:
27    ///
28    /// Default Constructor.
29    ///
30    inline OneDimensional(void) {}
31
32    ///
33    /// Destructor
34    ///
35    virtual ~OneDimensional(void) {};
36         
37    ///
38    /// This function computes the best-fit given a model (see
39    /// specific class for details) by minimizing \f$
40    /// \sum{(\hat{y_i}-y_i)^2} \f$, where \f$ \hat{y} \f$ is the fitted value.
41    ///
42    virtual void fit(const gslapi::vector& x, const gslapi::vector& y)=0; 
43   
44    ///
45    /// function predicting in one point
46    ///
47    virtual void predict(const double x, double& y, double& y_err) const=0;
48
49    ///
50    ///
51    ///
52    /// @return stream of prediction values and parameters
53    ///
54    std::ostream& print(std::ostream&,const double min, 
55                        const double max, const u_int n) const;
56             
57    ///
58    /// @return header for print()
59    ///
60    virtual std::ostream& print_header(std::ostream& s) const=0;
61             
62  protected:
63    ///
64    /// Averager for pair of x and y
65    ///
66    AveragerPair ap_;
67
68  };
69
70}}} // of namespaces regression, statisitcs and thep
71
72#endif
Note: See TracBrowser for help on using the repository browser.