|
| Distance () |
|
void | calculate (std::vector< double > pdf, std::vector< double > gauss, double minFluc, double binwidth) |
|
◆ Distance()
double KLDivergence
Definition OpHistogram.cpp:27
double L1norm
Definition OpHistogram.cpp:29
double HistIntersection
Definition OpHistogram.cpp:26
double JSDivergence
Definition OpHistogram.cpp:28
double L2norm
Definition OpHistogram.cpp:30
◆ calculate()
void Distance::calculate |
( |
std::vector< double > |
pdf, |
|
|
std::vector< double > |
gauss, |
|
|
double |
minFluc, |
|
|
double |
binwidth |
|
) |
| |
|
inline |
34 {
40
41 for(int bin = 0;bin < pdf.size(); ++bin) {
42
43 if( isnan(pdf[bin]) ) {
44 std::cerr << " # Warning: ProbDensity[" << bin << " = " << pdf[bin] << std::endl;
45 continue;
46 }
48 KLDivergence += binwidth * pdf[bin] *log(pdf[bin]/gauss[bin]);
49 JSDivergence += binwidth *gauss[bin] *log(gauss[bin]/pdf[bin]);
50 L1norm += binwidth *fabs( pdf[bin]-gauss[bin] );
51 L2norm += binwidth *( pdf[bin]-gauss[bin] )*( pdf[bin]-gauss[bin] );
52 }
55 };
◆ HistIntersection
double Distance::HistIntersection |
◆ JSDivergence
double Distance::JSDivergence |
◆ KLDivergence
double Distance::KLDivergence |
◆ L1norm
◆ L2norm
The documentation for this class was generated from the following file: