mirror of https://github.com/jlizier/jidt
Renaming (Apparent) TE discrete calculator to remove "Apparent" in all of the non-Java demo code
This commit is contained in:
parent
515fdd1432
commit
e44eba7199
|
|
@ -14,7 +14,7 @@
|
|||
% - timeSteps - number of rows to execute the CA for (including the random initial row)
|
||||
% - measureId - which local info dynamics measure to plot - can be a string or an integer as follows:
|
||||
% - 'active', 0 - active information storage (requires measureParams.k)
|
||||
% - 'transfer', 1 - apparent transfer entropy (requires measureParams.k and j)
|
||||
% - 'transfer', 1 - pairwise or apparent transfer entropy (requires measureParams.k and j)
|
||||
% - 'transfercomplete', 2 - complete transfer entropy (requires measureParams.k and j)
|
||||
% - 'separable', 3 - separable information (requires measureParams.k)
|
||||
% - 'entropy', 4 - excess entropy (requires no params)
|
||||
|
|
@ -154,7 +154,7 @@ function [caStates, localValues] = plotLocalInfoMeasureForCA(neighbourhood, base
|
|||
if (measureParams.j == 0)
|
||||
error('Cannot compute transfer entropy from a cell to itself (setting measureParams.j == 0)');
|
||||
end
|
||||
transferCalc = javaObject('infodynamics.measures.discrete.ApparentTransferEntropyCalculator', base, measureParams.k);
|
||||
transferCalc = javaObject('infodynamics.measures.discrete.TransferEntropyCalculator', base, measureParams.k);
|
||||
transferCalc.initialise();
|
||||
transferCalc.addObservations(caStatesJInts, measureParams.j);
|
||||
avTransfer = transferCalc.computeAverageLocalOfObservations();
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ function transferWithSourceMemory(savePlot)
|
|||
y = [rand() < 0.5; x1(1:N)];
|
||||
|
||||
% Compute TEs
|
||||
teCalc = javaObject('infodynamics.measures.discrete.ApparentTransferEntropyCalculator', 4, 1);
|
||||
teCalc = javaObject('infodynamics.measures.discrete.TransferEntropyCalculator', 4, 1);
|
||||
teCalc.initialise();
|
||||
teCalc.addObservations(y, x);
|
||||
teXnToYnplus1(deltaIndex) = teCalc.computeAverageLocalOfObservations();
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ function teValues = runTentMap()
|
|||
tic;
|
||||
|
||||
% Construct for binary values, k=1 history length
|
||||
teCalc=javaObject('infodynamics.measures.discrete.ApparentTransferEntropyCalculator', 2, 1);
|
||||
teCalc=javaObject('infodynamics.measures.discrete.TransferEntropyCalculator', 2, 1);
|
||||
|
||||
teValues = zeros(numberOfRuns, length(couplings));
|
||||
for couplingIndex = 1:length(couplings)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ sourceArray=(rand(100,1)>0.5)*1;
|
|||
destArray = [0; sourceArray(1:99)];
|
||||
sourceArray2=(rand(100,1)>0.5)*1;
|
||||
% Create a TE calculator and run it:
|
||||
teCalc=javaObject('infodynamics.measures.discrete.ApparentTransferEntropyCalculator', 2, 1);
|
||||
teCalc=javaObject('infodynamics.measures.discrete.TransferEntropyCalculator', 2, 1);
|
||||
teCalc.initialise();
|
||||
% Since we have simple arrays of ints, we can directly pass these in:
|
||||
teCalc.addObservations(destArray, sourceArray);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ twoDTimeSeriesOctave(2, :) = [twoDTimeSeriesOctave(1,100), twoDTimeSeriesOctave(
|
|||
twoDTimeSeriesJavaInt = octaveToJavaIntMatrix(twoDTimeSeriesOctave);
|
||||
|
||||
% Create a TE calculator and run it:
|
||||
teCalc=javaObject('infodynamics.measures.discrete.ApparentTransferEntropyCalculator', 2, 1);
|
||||
teCalc=javaObject('infodynamics.measures.discrete.TransferEntropyCalculator', 2, 1);
|
||||
teCalc.initialise();
|
||||
% Add observations of transfer across one cell to the right per time step:
|
||||
teCalc.addObservations(twoDTimeSeriesJavaInt, 1);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ sourceArray2=(rand(numObservations,2)>0.5)*1;
|
|||
% and an XOR of the two bits of the source in bit 2:
|
||||
destArray = [0, 0; sourceArray(1:numObservations-1, 1), xor(sourceArray(1:numObservations-1, 1), sourceArray(1:numObservations-1, 2))];
|
||||
% Create a TE calculator and run it:
|
||||
teCalc=javaObject('infodynamics.measures.discrete.ApparentTransferEntropyCalculator', 4, 1);
|
||||
teCalc=javaObject('infodynamics.measures.discrete.TransferEntropyCalculator', 4, 1);
|
||||
teCalc.initialise();
|
||||
% We need to construct the joint values of the dest and source before we pass them in,
|
||||
% and need to use the matrix conversion routine when calling from Matlab/Octave:
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ destArray = [0] + sourceArray[0:99];
|
|||
sourceArray2 = [random.randint(0,1) for r in xrange(100)]
|
||||
|
||||
# Create a TE calculator and run it:
|
||||
teCalcClass = JPackage("infodynamics.measures.discrete").ApparentTransferEntropyCalculator
|
||||
teCalcClass = JPackage("infodynamics.measures.discrete").TransferEntropyCalculator
|
||||
teCalc = teCalcClass(2,1)
|
||||
teCalc.initialise()
|
||||
# Since we have simple arrays of ints, we can directly pass these in:
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ twoDTimeSeriesPython.append(row2)
|
|||
twoDTimeSeriesJavaInt = JArray(JInt, 2)(twoDTimeSeriesPython); # 2 indicating 2D array
|
||||
|
||||
# Create a TE calculator and run it:
|
||||
teCalcClass = JPackage("infodynamics.measures.discrete").ApparentTransferEntropyCalculator
|
||||
teCalcClass = JPackage("infodynamics.measures.discrete").TransferEntropyCalculator
|
||||
teCalc = teCalcClass(2,1)
|
||||
teCalc.initialise()
|
||||
# Add observations of transfer across one cell to the right per time step:
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ for j in range(1,numObservations):
|
|||
destArray.append([sourceArray[j-1][0], xor(sourceArray[j-1][0], sourceArray[j-1][1])])
|
||||
|
||||
# Create a TE calculator and run it:
|
||||
teCalcClass = JPackage("infodynamics.measures.discrete").ApparentTransferEntropyCalculator
|
||||
teCalcClass = JPackage("infodynamics.measures.discrete").TransferEntropyCalculator
|
||||
teCalc = teCalcClass(4,1)
|
||||
teCalc.initialise()
|
||||
# We need to construct the joint values of the dest and source before we pass them in,
|
||||
|
|
|
|||
Loading…
Reference in New Issue