Code covered by the BSD License  

Highlights from
Mutual Information In probability theory and information theory

from Mutual Information In probability theory and information theory by Guangdi Li
Code for marginally and conditional mutual information in probability and information theory

ControlCentor.m
%ControlCentor
% when you test the code,please correct the directory in next command
load('G:\MutualInformation\TrainingData\Sample.mat');
% Sample is a variable that saves our training database, each row is a case
%  while each column represents different variables.
LGObj = ConstructLGObj( Sample); % construct an object
Var1 = 2;
Var2 = 4;
% I(V2,V4)=? mutual information between variable V2 and V4
[MI,R,N ] = MarginallyIndependent_MutualInformation( LGObj, Var1,Var2 ) 

ConditionalVar = [3 6];
%I(V2,V6|V3,V6)=? conditional mutual information between variable V2 and V4
% given variables V3 and V6. 
[MI,R,M ] = ConditionallyIndependent_MutualInformation( LGObj,Var1,Var2,ConditionalVar ) 

% it returns mutual information matric which cosists of all pairs I(A,B)
MI_Matric = MutualInformationWeightMatric( LGObj )


% For advance users, mex programming for fast computation of mutual
% information is provided. Try:
mex ConditionalProbability.c
mex ConditionallyIndependent_MutualInformation.c

Contact us at files@mathworks.com