Medical Imaging Interaction Toolkit  2018.4.99-b20efe7f
Medical Imaging Interaction Toolkit
mitkGeneralizedLinearModel.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkGeneralizedLinearModel_h
14 #define mitkGeneralizedLinearModel_h
15 
17 
18 #include <vnl/vnl_matrix.h>
19 #include <vnl/vnl_vector.h>
20 
21 namespace mitk
22 {
31  {
32  public:
43  GeneralizedLinearModel (const vnl_matrix<double> &xData, const vnl_vector<double> &yData, bool addConstantColumn=true);
44 
56  double Predict(const vnl_vector<double> &c);
57 
69  vnl_vector<double> Predict(const vnl_matrix<double> &x);
70 
79  vnl_vector<double> ExpMu(const vnl_matrix<double> &x);
80 
84  vnl_vector<double> B();
85 
86  private:
87 
88  // Estimates the rank of the matrix and creates a permutation vector so
89  // that the most important columns are first. Depends on a QR-algorithm.
90  void EstimatePermutation(const vnl_matrix<double> &xData);
91 
92  vnl_vector<unsigned int> m_Permutation; // Holds a permutation matrix which is used during calculation of B
93  vnl_vector<double> m_B; // B-Values. Linear componentn of the model.
94  bool m_AddConstantColumn; // If true, a constant value is added to each row
95 // int m_Rank; // The estimated input rank of the matrix.
96  };
97 }
98 
99 #endif //mitkGeneralizedLInearModel_h
DataCollection - Class to facilitate loading/accessing structured data.
Generalized Linear Model that allows linear models for non-gaussian data.
#define MITKCLIMPORTANCEWEIGHTING_EXPORT