queso-0.53.0
InfoTheory.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_INFO_THEORY_H
26 #define UQ_INFO_THEORY_H
27 
28 #include <queso/Defines.h>
29 #ifdef QUESO_HAS_ANN
30 
31 #include <ANN/ANN.h>
32 #include <ANN/ANNx.h>
33 #include <gsl/gsl_sf_psi.h>
34 
35 // TODO: create InfoTheoryOptions
36 #define UQ_INFTH_ANN_NO_SMP 10000
37 #define UQ_INFTH_ANN_EPS 0.0
38 #define UQ_INFTH_ANN_KNN 6
39 
40 namespace QUESO {
41 
42 void distANN_XY( const ANNpointArray dataX, const ANNpointArray dataY,
43  double* distsXY,
44  unsigned int dimX, unsigned int dimY,
45  unsigned int xN, unsigned int yN,
46  unsigned int k, double eps );
47 
48 void normalizeANN_XY( ANNpointArray dataXY, unsigned int dimXY,
49  ANNpointArray dataX, unsigned int dimX,
50  ANNpointArray dataY, unsigned int dimY,
51  unsigned int N );
52 
53 void whiteningANN_X_Y( ANNpointArray dataX1, ANNpointArray dataX2,
54  unsigned int dimX, unsigned int N1, unsigned int N2 );
55 
56 double computeMI_ANN( ANNpointArray dataXY,
57  unsigned int dimX, unsigned int dimY,
58  unsigned int k, unsigned int N, double eps );
59 
60 //*****************************************************
61 // Function: estimateMI_ANN (using a joint)
62 // (Mutual Information)
63 //*****************************************************
64 template <template <class P_V, class P_M> class RV, class P_V, class P_M>
65 double estimateMI_ANN( const RV<P_V,P_M>& jointRV,
66  const unsigned int xDimSel[], unsigned int dimX,
67  const unsigned int yDimSel[], unsigned int dimY,
68  unsigned int k, unsigned int N, double eps );
69 
70 //*****************************************************
71 // Function: estimateMI_ANN (using two seperate RVs)
72 // (Mutual Information)
73 //*****************************************************
74 template <class P_V, class P_M,
75  template <class P_V, class P_M> class RV_1,
76  template <class P_V, class P_M> class RV_2>
77 double estimateMI_ANN( const RV_1<P_V,P_M>& xRV,
78  const RV_2<P_V,P_M>& yRV,
79  const unsigned int xDimSel[], unsigned int dimX,
80  const unsigned int yDimSel[], unsigned int dimY,
81  unsigned int k, unsigned int N, double eps );
82 
83 //*****************************************************
84 // Function: estimateKL_ANN
85 // (Kullback-Leibler divergence)
86 //*****************************************************
87 template <class P_V, class P_M,
88  template <class P_V, class P_M> class RV_1,
89  template <class P_V, class P_M> class RV_2>
90 double estimateKL_ANN( RV_1<P_V,P_M>& xRV,
91  RV_2<P_V,P_M>& yRV,
92  unsigned int xDimSel[], unsigned int dimX,
93  unsigned int yDimSel[], unsigned int dimY,
94  unsigned int xN, unsigned int yN,
95  unsigned int k, double eps );
96 
97 //*****************************************************
98 // Function: estimateCE_ANN
99 // (Cross Entropy)
100 //*****************************************************
101 template <class P_V, class P_M,
102  template <class P_V, class P_M> class RV_1,
103  template <class P_V, class P_M> class RV_2>
104 double estimateCE_ANN( RV_1<P_V,P_M>& xRV,
105  RV_2<P_V,P_M>& yRV,
106  unsigned int xDimSel[], unsigned int dimX,
107  unsigned int yDimSel[], unsigned int dimY,
108  unsigned int xN, unsigned int yN,
109  unsigned int k, double eps );
110 
111 } // End namespace QUESO
112 
113 #endif // QUESO_HAS_ANN
114 
115 #endif // UQ_INFO_THEORY_H
double eps
Definition: ann_sample.cpp:55
ANNpoint * ANNpointArray
Definition: ANN.h:376
int k
Definition: ann_sample.cpp:53

Generated on Thu Jun 11 2015 13:52:32 for queso-0.53.0 by  doxygen 1.8.5