yat  0.14.5pre
PCA.h
1 #ifndef _theplu_yat_utility_pca_
2 #define _theplu_yat_utility_pca_
3 
4 // $Id: PCA.h 2382 2010-12-21 13:16:58Z peter $
5 
6 /*
7  Copyright (C) 2003 Daniel Dalevi
8  Copyright (C) 2004 Jari Häkkinen
9  Copyright (C) 2005 Jari Häkkinen, Peter Johansson
10  Copyright (C) 2006 Jari Häkkinen
11  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
12  Copyright (C) 2010 Peter Johansson
13 
14  This file is part of the yat library, http://dev.thep.lu.se/yat
15 
16  The yat library is free software; you can redistribute it and/or
17  modify it under the terms of the GNU General Public License as
18  published by the Free Software Foundation; either version 3 of the
19  License, or (at your option) any later version.
20 
21  The yat library is distributed in the hope that it will be useful,
22  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24  General Public License for more details.
25 
26  You should have received a copy of the GNU General Public License
27  along with yat. If not, see <http://www.gnu.org/licenses/>.
28 */
29 
30 #include "Matrix.h"
31 #include "Vector.h"
32 
33 namespace theplu {
34 namespace yat {
35 namespace utility {
36 
51  class PCA
52  {
53  public:
58  explicit PCA(const Matrix&);
59 
66  const Vector& eigenvalues(void) const;
67 
74  const Matrix& eigenvectors(void) const;
75 
83  Matrix projection(const Matrix&) const;
84 
85  private:
86 
94  void process(void);
95 
101  void row_center(Matrix& A_center);
102 
103  utility::Matrix A_;
104  utility::Vector eigenvalues_;
105  utility::Matrix eigenvectors_;
106  utility::Vector meanvalues_;
107  };
108 
109 }}} // of namespace utility, yat, and theplu
110 
111 #endif
Matrix projection(const Matrix &) const
This is the yat interface to GSL vector.
Definition: Vector.h:57
const Vector & eigenvalues(void) const
Returns eigenvalues.
const Matrix & eigenvectors(void) const
Get all eigenvectors in a Matrix.
Interface to GSL matrix.
Definition: Matrix.h:63
Principal Component Analysis.
Definition: PCA.h:51

Generated on Tue Sep 26 2017 02:33:29 for yat by  doxygen 1.8.5