yat
0.8.3pre
|
00001 #ifndef _theplu_yat_regression_multidimensional_ 00002 #define _theplu_yat_regression_multidimensional_ 00003 00004 // $Id: MultiDimensional.h 2126 2009-12-22 20:45:07Z peter $ 00005 00006 /* 00007 Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson 00008 Copyright (C) 2009 Peter Johansson 00009 00010 This file is part of the yat library, http://dev.thep.lu.se/yat 00011 00012 The yat library is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU General Public License as 00014 published by the Free Software Foundation; either version 3 of the 00015 License, or (at your option) any later version. 00016 00017 The yat library is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 General Public License for more details. 00021 00022 You should have received a copy of the GNU General Public License 00023 along with yat. If not, see <http://www.gnu.org/licenses/>. 00024 */ 00025 00026 #include "yat/utility/Matrix.h" 00027 #include "yat/utility/Vector.h" 00028 00029 #include <gsl/gsl_multifit.h> 00030 00031 namespace theplu { 00032 namespace yat { 00033 namespace regression { 00034 00038 class MultiDimensional 00039 { 00040 public: 00041 00045 MultiDimensional(void); 00046 00050 ~MultiDimensional(void); 00051 00055 const utility::Matrix& covariance(void) const; 00056 00067 void fit(const utility::Matrix& X, const utility::VectorBase& y); 00068 00072 const utility::Vector& fit_parameters(void) const; 00073 00077 double chisq(void) const; 00078 00082 double predict(const utility::VectorBase& x) const; 00083 00088 double prediction_error2(const utility::VectorBase& x) const; 00089 00093 double standard_error2(const utility::VectorBase& x) const; 00094 00095 private: 00096 // no copy allowed 00097 MultiDimensional(const MultiDimensional&); 00098 MultiDimensional& operator=(const MultiDimensional&); 00099 00100 double chisquare_; 00101 double s2_; 00102 utility::Matrix covariance_; 00103 utility::Vector fit_parameters_; 00104 gsl_multifit_linear_workspace* work_; 00105 00106 }; 00107 00108 }}} // of namespaces regression, yat, and theplu 00109 00110 #endif