Code covered by the BSD License  

Highlights from
ProcessNetwork Version 1.0 Software

image thumbnail

ProcessNetwork Version 1.0 Software

by

 

Functions for the delineation of Dynamical Process Networks using Information Theory

entropyFunction(classifiedData,lagVect,nBinMat,NoDataCode,nTests,oneTailZ)
function [E] = entropyFunction(classifiedData,lagVect,nBinMat,NoDataCode,nTests,oneTailZ)

[nData,nSignals] = size(classifiedData);
[nLags,~]=size(lagVect); %nLags includes the zero lag which is first
lagMax=max(lagVect);
nTuples = nData-lagMax-1;

% INITIALIZE PARALLEL OUTPUTS OF THE SHANNON BIT FUNCTION
HXt                     = NaN(nSignals,nSignals,nLags);
HYw                     = NaN(nSignals,nSignals,nLags);
HYf                     = NaN(nSignals,nSignals,nLags);
HXtYw                   = NaN(nSignals,nSignals,nLags);
HXtYf                   = NaN(nSignals,nSignals,nLags);
HYwYf                   = NaN(nSignals,nSignals,nLags);
HXtYwYf                 = NaN(nSignals,nSignals,nLags);
I                       = NaN(nSignals,nSignals,nLags);
T                       = NaN(nSignals,nSignals,nLags);
meanShuffT              = NaN(nSignals,nSignals,nLags);
sigmaShuffT             = NaN(nSignals,nSignals,nLags);
meanShuffI              = NaN(nSignals,nSignals,nLags);
sigmaShuffI             = NaN(nSignals,nSignals,nLags);
nCounts                 = NaN(nSignals,nSignals,nLags);

% PARALLELIZE ON MULTIPLE TIME LAGS
parfor i = 1:nLags  %lag-step starts at one, which is the index
        
    if i == 1
        isFirstLag = 1;
    else
        isFirstLag = 0;
    end
        
    [   HXt(:,:,i), ...
        HYw(:,:,i), ...
        HYf(:,:,i), ...
        HXtYw(:,:,i), ...
        HXtYf(:,:,i), ...
        HYwYf(:,:,i), ...
        HXtYwYf(:,:,i), ...
        I(:,:,i), ...
        T(:,:,i), ...        
        meanShuffT(:,:,i), ...
        sigmaShuffT(:,:,i), ...
        meanShuffI(:,:,i),...
        sigmaShuffI(:,:,i), ...
        nCounts(:,:,i) ] ...
        = ShannonBitsWrapper...
        ( nSignals, ...
        lagVect(i), ...
        NoDataCode, ...
        nTuples, ...
        nTests, ...
        classifiedData, ...
        nBinMat, ...
        i, ...
        isFirstLag      );
            
end

% ASSIGN ALL OUTPUT VARIABLES TO THE TRANSFER STRUCTURE "E"
E.HXt=HXt;
E.HYw=HYw;
E.HYf=HYf;
E.HXtYw=HXtYw;
E.HXtYf=HXtYf;
E.HYwYf=HYwYf;
E.HXtYwYf=HXtYwYf;
E.I=I;
E.T=T;
E.meanShuffT=meanShuffT(:,:,1);
E.sigmaShuffT=sigmaShuffT(:,:,1);
E.meanShuffI=meanShuffI(:,:,1);
E.sigmaShuffI=sigmaShuffI(:,:,1);
E.nCounts=nCounts;
E.SigThreshT = E.meanShuffT+oneTailZ*E.sigmaShuffT;
E.SigThreshI = E.meanShuffI+oneTailZ*E.sigmaShuffI;

% CALCULATED QUANTITIES
[E.Tplus,E.Tminus,E.Tnet,E.TnetBinary]=DoProduction(E.T);
[E.InormByDist,E.TnormByDist,E.SigThreshInormByDist,E.SigThreshTnormByDist,E.Ic,E.Tc,E.TvsIzero,E.SigThreshTvsIzero,E.RelEnt,E.RelT]=NormTheStats(nBinMat,E.I,E.T,E.SigThreshI,E.SigThreshT,E.meanShuffI,E.sigmaShuffI,E.meanShuffT,E.sigmaShuffT,HXt,HYw,HYf);
[E.Abinary,E.Awtd,E.AwtdCut,E.charLagFirstPeak,E.TcharLagFirstPeak,E.charLagMaxPeak,E.TcharLagMaxPeak,E.TvsIzerocharLagMaxPeak,E.nSigLags,E.FirstSigLag,E.LastSigLag]=AdjMatrices(E.TnormByDist,E.SigThreshTnormByDist,E.TvsIzero);


Contact us