Last change
on this file since 221 was
221,
checked in by Peter, 17 years ago

interface to regression modified


Property svn:eolstyle set to
native

Property svn:keywords set to
Author Date Id Revision

File size:
1.4 KB

Line  

1  // $Id: Regression.h 221 20041230 22:36:25Z peter $ 

2  

3  #ifndef _theplu_statistics_regression_ 

4  #define _theplu_statistics_regression_ 

5  

6  // C++ tools include 

7  ///////////////////// 

8  #include "vector.h" 

9  

10  // Standard C++ includes 

11  //////////////////////// 

12  

13  

14  namespace theplu { 

15  namespace statistics { 

16  

17  

18  /// 

19  /// Virtual Class for Regression. 

20  /// 

21  

22  class Regression 

23  { 

24  

25  public: 

26  /// 

27  /// Default Constructor. 

28  /// 

29  Regression(); 

30  

31  /// 

32  /// Destructor 

33  /// 

34  virtual ~Regression(void) {}; 

35  

36  /// 

37  /// This function computes the bestfit given a model (see 

38  /// specific class for details) by minimizing \f$ 

39  /// \sum{(\hat{y_i}y_i)^2} \f$, where \f$ \hat{y} \f$ is the fitted value. 

40  /// 

41  virtual void fit(const gslapi::vector& x, const gslapi::vector& y)=0; 

42  

43  /// 

44  /// This function computes the bestfit given a model (see 

45  /// specific class for details) by minimizing \f$ 

46  /// \sum{w_i(\hat{y_i}y_i)^2} \f$, where \f$ \hat{y} \f$ is the 

47  /// fitted value. The weight \f$ w_i \f$ is should be proportional 

48  /// to the inverse of the variance for \f$ y_i \f$ 

49  /// 

50  virtual void fit(const gslapi::vector& x, const gslapi::vector& y, 

51  const gslapi::vector& w)=0; 

52  /// 

53  /// 

54  /// 

55  virtual void predict(const double x, double& y, double& y_err, 

56  const double w=1) const=0; 

57  

58  protected: 

59  

60  }; 

61  

62  }} // of namespace statistics and namespace theplu 

63  

64  #endif 

65  

Note: See
TracBrowser
for help on using the repository browser.