No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Kullback-Leibler Divergence

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.2 | 4 ratings Rate this file 114 Downloads (last 30 days) File Size: 982 Bytes File ID: #20688 Version: 1.0

Kullback-Leibler Divergence


Nima Razavi (view profile)


13 Jul 2008 (Updated )

Calculates the Kullback-Leibler Divergence between two probability distributions

| Watch this File

File Information

For the description of the divergence you can take a look at :

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
18 Oct 2016 Aminullah khan  
03 Dec 2014 hello_world

I have two probability matrix P and Q of size m x n and q x n each. How to calculate KL-divergence for these two matrices?

27 Apr 2014 Erkin

Erkin (view profile)

Shouldn't the log value be log2 instead of natural logarithm?

Comment only
18 Apr 2014 wang

wang (view profile)

Sir, can you give a detailed description of P and Q in this function? example better.

Comment only
07 Aug 2013 Maysam Shahedi

Maysam Shahedi (view profile)

18 Oct 2011 amjad khan

dear sir we need kld for feature selection in MRI brain image can some one help me

Comment only
07 May 2011 Hung nguyen  
07 Mar 2011 Nate Greene

Please note that the logarithms should be base 2 if calculating values in bits.

Comment only
14 Jul 2008 Dimitri Shvorob

Your implementation is third of its kind on FEX: please take time to search FEX for existing code before posting.

Comment only

Contact us