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

MutualInformationWeightMatric( LGObj )
function    MI_Matric = MutualInformationWeightMatric( LGObj )
% This function builds a matric that measures the weight( Ip(Ci, Cj) ) between node i and
% node j. It is used in maximizing the weighted spanning tree for class
% subgraph in the third step.

%Input: OriginData is the Original sample, Dim is the value range of classes.
%Output: CIW_Matric is the class information weight matric. 
  LG = struct(LGObj);
  Dim = LG.VarNumber;
  MI_Matric = zeros( Dim );
      for r = 1 : (Dim-1)
           for c = (r+1) : Dim      %IW_Matric is symmetric
                MI_Matric( r,c ) = ConditionallyIndependent_MutualInformation( LGObj,r ,c  );
                MI_Matric( c,r ) = MI_Matric( r,c ); 
             %  since all information is already in upper triangular.
           end
      end
end

Contact us at files@mathworks.com