queso-0.55.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
stats
inc
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
34
// TODO: create InfoTheoryOptions
35
#define UQ_INFTH_ANN_NO_SMP 10000
36
#define UQ_INFTH_ANN_EPS 0.0
37
#define UQ_INFTH_ANN_KNN 6
38
39
namespace
QUESO {
40
41
void
distANN_XY(
const
ANNpointArray
dataX,
const
ANNpointArray
dataY,
42
double
* distsXY,
43
unsigned
int
dimX,
unsigned
int
dimY,
44
unsigned
int
xN,
unsigned
int
yN,
45
unsigned
int
k
,
double
eps
);
46
47
void
normalizeANN_XY(
ANNpointArray
dataXY,
unsigned
int
dimXY,
48
ANNpointArray
dataX,
unsigned
int
dimX,
49
ANNpointArray
dataY,
unsigned
int
dimY,
50
unsigned
int
N );
51
52
void
whiteningANN_X_Y(
ANNpointArray
dataX1,
ANNpointArray
dataX2,
53
unsigned
int
dimX,
unsigned
int
N1,
unsigned
int
N2 );
54
55
double
computeMI_ANN(
ANNpointArray
dataXY,
56
unsigned
int
dimX,
unsigned
int
dimY,
57
unsigned
int
k
,
unsigned
int
N,
double
eps
);
58
59
//*****************************************************
60
// Function: estimateMI_ANN (using a joint)
61
// (Mutual Information)
62
//*****************************************************
63
template
<
template
<
class
P_V,
class
P_M>
class
RV,
class
P_V,
class
P_M>
64
double
estimateMI_ANN(
const
RV<P_V,P_M>& jointRV,
65
const
unsigned
int
xDimSel[],
unsigned
int
dimX,
66
const
unsigned
int
yDimSel[],
unsigned
int
dimY,
67
unsigned
int
k
,
unsigned
int
N,
double
eps
);
68
69
//*****************************************************
70
// Function: estimateMI_ANN (using two seperate RVs)
71
// (Mutual Information)
72
//*****************************************************
73
template
<
class
P_V,
class
P_M,
74
template
<
class
P_V,
class
P_M>
class
RV_1,
75
template
<
class
P_V,
class
P_M>
class
RV_2>
76
double
estimateMI_ANN(
const
RV_1<P_V,P_M>& xRV,
77
const
RV_2<P_V,P_M>& yRV,
78
const
unsigned
int
xDimSel[],
unsigned
int
dimX,
79
const
unsigned
int
yDimSel[],
unsigned
int
dimY,
80
unsigned
int
k
,
unsigned
int
N,
double
eps
);
81
82
//*****************************************************
83
// Function: estimateKL_ANN
84
// (Kullback-Leibler divergence)
85
//*****************************************************
86
template
<
class
P_V,
class
P_M,
87
template
<
class
P_V,
class
P_M>
class
RV_1,
88
template
<
class
P_V,
class
P_M>
class
RV_2>
89
double
estimateKL_ANN( RV_1<P_V,P_M>& xRV,
90
RV_2<P_V,P_M>& yRV,
91
unsigned
int
xDimSel[],
unsigned
int
dimX,
92
unsigned
int
yDimSel[],
unsigned
int
dimY,
93
unsigned
int
xN,
unsigned
int
yN,
94
unsigned
int
k
,
double
eps
);
95
96
//*****************************************************
97
// Function: estimateCE_ANN
98
// (Cross Entropy)
99
//*****************************************************
100
template
<
class
P_V,
class
P_M,
101
template
<
class
P_V,
class
P_M>
class
RV_1,
102
template
<
class
P_V,
class
P_M>
class
RV_2>
103
double
estimateCE_ANN( RV_1<P_V,P_M>& xRV,
104
RV_2<P_V,P_M>& yRV,
105
unsigned
int
xDimSel[],
unsigned
int
dimX,
106
unsigned
int
yDimSel[],
unsigned
int
dimY,
107
unsigned
int
xN,
unsigned
int
yN,
108
unsigned
int
k
,
double
eps
);
109
110
}
// End namespace QUESO
111
112
#endif // QUESO_HAS_ANN
113
114
#endif // UQ_INFO_THEORY_H
ANNx.h
eps
double eps
Definition:
ann_sample.cpp:55
k
int k
Definition:
ann_sample.cpp:53
ANNpointArray
ANNpoint * ANNpointArray
Definition:
ANN.h:376
ANN.h
Generated on Fri Jun 17 2016 14:17:41 for queso-0.55.0 by
doxygen
1.8.5