From cab3de8b07d0097a7a0640f2fffd9f376db34dfd Mon Sep 17 00:00:00 2001 From: Joseph Lizier Date: Fri, 28 Mar 2025 15:15:30 +1100 Subject: [PATCH] Bug fix to local TE for spike trains code; forgot to increment the index when computing local values, fixed. --- .../TransferEntropyCalculatorSpikingIntegration.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/source/infodynamics/measures/spiking/integration/TransferEntropyCalculatorSpikingIntegration.java b/java/source/infodynamics/measures/spiking/integration/TransferEntropyCalculatorSpikingIntegration.java index f7fba21..088296f 100644 --- a/java/source/infodynamics/measures/spiking/integration/TransferEntropyCalculatorSpikingIntegration.java +++ b/java/source/infodynamics/measures/spiking/integration/TransferEntropyCalculatorSpikingIntegration.java @@ -724,7 +724,7 @@ public class TransferEntropyCalculatorSpikingIntegration implements TransferEntr * We take the actual joint tree at spikes (along with the associated embeddings) as an argument, as we will need to swap these out when * computing surrogates. */ - public TERateResults computeAverageLocalOfObservations(KdTree actualKdTreeJointAtSpikes, Vector actualJointEmbeddingsFromSpikes) throws Exception { + protected TERateResults computeAverageLocalOfObservations(KdTree actualKdTreeJointAtSpikes, Vector actualJointEmbeddingsFromSpikes) throws Exception { double currentSum = 0; int numTargetSpikesToSkip = MatrixUtils.max(destPastIntervals); @@ -855,6 +855,7 @@ public class TransferEntropyCalculatorSpikingIntegration implements TransferEntr } throw new Exception("NaNs in TE clac " + radiusJointSpikes + " " + radiusJointSamples + " " + tempRadiusJointSamples); } + indexInLocals++; // Move to record the next local value } // Normalise by time double timeSum = 0; @@ -962,6 +963,7 @@ public class TransferEntropyCalculatorSpikingIntegration implements TransferEntr return new EmpiricalMeasurementDistribution(surrogateTEValues, estimatedValue); } + // Data structure to return local values from this estimator public class SpikingTELocalValues implements SpikingLocalInformationValues { public double[] contributionsAtEachSpike;