Code covered by the BSD License  

Highlights from
Mutual Information

Be the first to rate this file! 88 Downloads (last 30 days) File Size: 1.33 KB File ID: #28694

Mutual Information

by Will Dwinnell

 

12 Sep 2010 (Updated 03 Jan 2012)

Calculates the mutual information between two discrete variables (or a group and a single variable).

| Watch this File

File Information
Description

MutualInformation: returns mutual information (in bits) of discrete variables 'X' and 'Y'

  I = MutualInformation(X,Y);
 
  I = calculated mutual information (in bits)
  X = variable(s) to be analyzed (column vector)
  Y = variable to be analyzed (column vector)
 
  Note 1: Multiple variables may be handled jointly as columns in
    matrix 'X'.
  Note 2: Requires the 'Entropy' and 'JointEntropy' functions.

MATLAB release MATLAB 6.0 (R12)
Other requirements Requires JointEntropy and Entropy functions.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
06 Dec 2010 Marcello Costa

Good Job

02 Jan 2012 Jun

I am not sure if I run the code right or there is a bug in the code.

I ran the following and got the answers below. Does not seem right to me. A and B are completely independent random numbers, which I verified.
 
>> A=rand(1,100);
>> B=rand(1,100);
>> MutualInformation(A',A')

ans =

    6.6439

>> MutualInformation(B',B')

ans =

    6.6439

>> MutualInformation(A',B')

ans =

    6.6439

03 Jan 2012 Will Dwinnell

This routine is intended for use with discrete variables, not continuous ones.

Please login to add a comment or rating.
Updates
03 Jan 2012

I have updated the description to clarify the use of this routine.

Tag Activity for this File
Tag Applied By Date/Time
entropy Will Dwinnell 13 Sep 2010 10:11:31
information theory Will Dwinnell 13 Sep 2010 10:11:31
discrete Will Dwinnell 13 Sep 2010 10:11:31
mathematics Will Dwinnell 13 Sep 2010 10:11:31
statistics Will Dwinnell 13 Sep 2010 10:11:31
mutual information Will Dwinnell 13 Sep 2010 10:11:31
mutual information Hopester Hope 10 Dec 2010 10:50:15
mutual information sergio de iorio 14 Jun 2011 15:51:46
mutual information chiara Damiani 20 Jul 2011 07:23:41
entropy Pavol 15 Sep 2011 13:52:08

Contact us at files@mathworks.com