maxent_toolbox

Maximum Entropy toolbox for MATLAB

View the Project on GitHub orimaoz/maxent_toolbox

maxent.dkl

Description

Computes the Kullback-Leibler divergence between two distributions with a finite number of states. The inputs can be vectors of probabilities or log-probabilities (natural logarithm).

Usage

d = maxent.dkl(p1,p2)

Arguments

Mandatory arguments

  • p1- Vector of probabilities for the first distribution (or log probabilities in natural logarithm). The numbers should either be >=0 and sum to one, or their natural exponent should be >= and some to one.
  • p2 - Vector of probabilities for the second distribution (ame format as p1)

Output

  • d - Kullback-Leibler divergence between the distributions: DKL(p1||p2)