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