Adding bias calculation and local TE calculations to Matlab/Octave examples 3 and 4 respectively

This commit is contained in:
joseph.lizier 2014-08-22 05:10:40 +00:00
parent 643d76fe19
commit ef57fd2675
2 changed files with 11 additions and 0 deletions

View File

@ -45,3 +45,9 @@ result2 = teCalc.computeAverageLocalOfObservations();
fprintf('TE result %.4f bits; expected to be close to 0 bits for uncorrelated Gaussians but will be biased upwards\n', ...
result2);
% We can get insight into the bias by examining the null distribution:
nullDist = teCalc.computeSignificance(100);
fprintf(['Null distribution for unrelated source and destination ', ...
'(i.e. the bias) has mean %.4f and standard deviation %.4f\n'], ...
nullDist.getMeanOfDistribution(), nullDist.getStdOfDistribution());

View File

@ -48,4 +48,9 @@ teCalc.setObservations(sourceArray2, destArray);
result2 = teCalc.computeAverageLocalOfObservations();
fprintf('TE result %.4f nats; expected to be close to 0 nats for these uncorrelated Gaussians\n', result2);
% We can also compute the local TE values for the time-series samples here:
% (See more about utility of local TE in the CA demos)
localTE = teCalc.computeLocalOfPreviousObservations();
fprintf('Notice that the mean of locals, %.4f nats, equals the previous result\n', ...
sum(javaMatrixToOctave(localTE))/(numObservations-1));