def _updateInferenceStats(self, statistics, objectName=None):
    """
    Updates the inference statistics.

    Parameters:
    ----------------------------
    @param  statistics (dict)
            Dictionary in which to write the statistics

    @param  objectName (str)
            Name of the inferred object, if known. Otherwise, set to None.

    """
    L6aLearnableCells = self.getL6aLearnableCells()
    L6aSensoryAssociatedCells = self.getL6aSensoryAssociatedCells()
    L6aRepresentations = self.getL6aRepresentations()
    L4Representations = self.getL4Representations()
    L4PredictedCells = self.getL4PredictedCells()
    L2Representation = self.getL2Representations()

    for i in xrange(self.numColumns):
      statistics["L6a SensoryAssociatedCells C" + str(i)].append(
        len(L6aSensoryAssociatedCells[i]))
      statistics["L6a LearnableCells C" + str(i)].append(
        len(L6aLearnableCells[i]))
      statistics["L6a Representation C" + str(i)].append(
        len(L6aRepresentations[i]))
      statistics["L4 Representation C" + str(i)].append(
        len(L4Representations[i]))
      statistics["L4 Predicted C" + str(i)].append(len(L4PredictedCells[i]))
      statistics["L2 Representation C" + str(i)].append(
        len(L2Representation[i]))
      statistics["Full L2 SDR C" + str(i)].append(sorted(
        [int(c) for c in L2Representation[i]]))
      statistics["L4 Apical Segments C" + str(i)].append(len(
        self.L4Regions[i].getSelf()._tm.getActiveApicalSegments()))

      # add true overlap and classification result if objectName was learned
      if objectName in self.learnedObjects:
        objectRepresentation = self.learnedObjects[objectName]
        statistics["Overlap L2 with object C" + str(i)].append(
          len(objectRepresentation[i] & L2Representation[i]))

    if objectName in self.learnedObjects:
      if self.isObjectClassified(objectName, minOverlap=30):
        statistics["Correct classification"].append(1.0)
      else:
        statistics["Correct classification"].append(0.0)
Updates the inference statistics.

    Parameters:
    ----------------------------
    @param  statistics (dict)
            Dictionary in which to write the statistics

    @param  objectName (str)
            Name of the inferred object, if known. Otherwise, set to None.