qm-dsp 1.8
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/*
4 QM DSP Library
5
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2008 QMUL.
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
14*/
15
16#ifndef KLDIVERGENCE_H
17#define KLDIVERGENCE_H
18
19#include <vector>
20
21using std::vector;
22
27{
28public:
31
37 double distanceGaussian(const vector<double> &means1,
38 const vector<double> &variances1,
39 const vector<double> &means2,
40 const vector<double> &variances2);
41
48 double distanceDistribution(const vector<double> &d1,
49 const vector<double> &d2,
50 bool symmetrised);
51};
52
53#endif
54
Helper methods for calculating Kullback-Leibler divergences.
double distanceDistribution(const vector< double > &d1, const vector< double > &d2, bool symmetrised)
Calculate a Kullback-Leibler divergence of two probability distributions.
double distanceGaussian(const vector< double > &means1, const vector< double > &variances1, const vector< double > &means2, const vector< double > &variances2)
Calculate a symmetrised Kullback-Leibler divergence of Gaussian models based on mean and variance vec...