yat  0.16.4pre
MultiDimensional.h
1 #ifndef _theplu_yat_regression_multidimensional_
2 #define _theplu_yat_regression_multidimensional_
3 
4 // $Id: MultiDimensional.h 3661 2017-07-14 01:10:35Z peter $
5 
6 /*
7  Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2009, 2017 Peter Johansson
9 
10  This file is part of the yat library, http://dev.thep.lu.se/yat
11 
12  The yat library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU General Public License as
14  published by the Free Software Foundation; either version 3 of the
15  License, or (at your option) any later version.
16 
17  The yat library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with yat. If not, see <http://www.gnu.org/licenses/>.
24 */
25 
26 #include "Multivariate.h"
27 
28 #include "yat/utility/Matrix.h"
29 #include "yat/utility/Vector.h"
30 
31 #include <gsl/gsl_multifit.h>
32 
33 namespace theplu {
34 namespace yat {
35 namespace regression {
36 
41  {
42  public:
43 
47  MultiDimensional(void);
48 
52  ~MultiDimensional(void);
53 
61  const utility::Matrix& covariance(void) const;
62 
73  void fit(const utility::Matrix& X, const utility::VectorBase& y);
74 
78  const utility::Vector& fit_parameters(void) const;
79 
83  double chisq(void) const;
84 
88  double predict(const utility::VectorBase& x) const;
89 
94  double prediction_error2(const utility::VectorBase& x) const;
95 
99  double standard_error2(const utility::VectorBase& x) const;
100 
101  private:
102  // no copy allowed
104  MultiDimensional& operator=(const MultiDimensional&);
105 
106  double chisquare_;
107  double s2_;
108  utility::Matrix covariance_;
109  utility::Vector fit_parameters_;
110  gsl_multifit_linear_workspace* work_;
111 
112  };
113 
114 }}} // of namespaces regression, yat, and theplu
115 
116 #endif
double standard_error2(const utility::VectorBase &x) const
void fit(const utility::Matrix &X, const utility::VectorBase &y)
Function fitting parameters of the linear model by miminizing the quadratic deviation between model a...
const utility::Vector & fit_parameters(void) const
The Department of Theoretical Physics namespace as we define it.
double prediction_error2(const utility::VectorBase &x) const
double chisq(void) const
Summed Squared Error.
double predict(const utility::VectorBase &x) const
Linear MultiDimesional regression.
Definition: MultiDimensional.h:40
This is the yat interface to GSL vector.
Definition: Vector.h:59
MultiDimensional(void)
Default Constructor.
This is the yat interface to GSL vector.
Definition: VectorBase.h:55
const utility::Matrix & covariance(void) const
covariance of parameters
Interface to GSL matrix.
Definition: Matrix.h:74
Definition: Multivariate.h:39

Generated on Thu Dec 12 2019 03:12:08 for yat by  doxygen 1.8.11