KLDivergence.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 /*
3  QM DSP Library
4 
5  Centre for Digital Music, Queen Mary, University of London.
6  This file copyright 2008 QMUL.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version. See the file
12  COPYING included with this distribution for more information.
13 */
14 
15 #ifndef QM_DSP_KLDIVERGENCE_H
16 #define QM_DSP_KLDIVERGENCE_H
17 
18 #include <vector>
19 
24 {
25 public:
28 
34  double distanceGaussian(const std::vector<double> &means1,
35  const std::vector<double> &variances1,
36  const std::vector<double> &means2,
37  const std::vector<double> &variances2);
38 
45  double distanceDistribution(const std::vector<double> &d1,
46  const std::vector<double> &d2,
47  bool symmetrised);
48 };
49 
50 #endif
51 
Helper methods for calculating Kullback-Leibler divergences.
Definition: KLDivergence.h:23
double distanceDistribution(const std::vector< double > &d1, const std::vector< double > &d2, bool symmetrised)
Calculate a Kullback-Leibler divergence of two probability distributions.
double distanceGaussian(const std::vector< double > &means1, const std::vector< double > &variances1, const std::vector< double > &means2, const std::vector< double > &variances2)
Calculate a symmetrised Kullback-Leibler divergence of Gaussian models based on mean and variance vec...