def initialize(self, originalTimeSeries, calculatedTimeSeries):
        # ErrorMeasure was already initialized.
        if 0 < len(self._errorValues):
            raise StandardError("An ErrorMeasure can only be initialized once.")

        # calculating the number of datapoints used within the history
        if isinstance(self._historyLength, float):
            self._historyLength = int((self._historyLength * len(originalTimeSeries)) / 100.0)

        # sort the TimeSeries to reduce the required comparison operations
        originalTimeSeries.sort_timeseries()
        calculatedTimeSeries.sort_timeseries()

        self._historicMeans = self._get_historic_means(originalTimeSeries)

        # Performance optimization
        append      = self._errorValues.append
        appendDates = self._errorDates.append
        local_error = self.local_error
        minCalcIdx  = self._historyLength + 1

        # calculate all valid local errors
        for orgPair in originalTimeSeries[minCalcIdx:]:
            for calcIdx in xrange(minCalcIdx, len(calculatedTimeSeries)):
                calcPair = calculatedTimeSeries[calcIdx]

                # Skip values that can not be compared
                if calcPair[0] != orgPair[0]:
                    continue

                append(local_error(orgPair[1:], calcPair[1:]))
                appendDates(orgPair[0])

        # return False, if the error cannot be calculated
        if len(filter(lambda item: item is not None, self._errorValues)) < self._minimalErrorCalculationPercentage * len(originalTimeSeries):
            self._errorValues = []
            self._errorDates = []
            self._historicMeans = []
            return False

        return True
Aux Function to center data
dataset/ETHPy150Open T-002/pycast/pycast/errors/meanabsolutescalederror.py/MeanAbsoluteScaledError.initialize--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/time_frequency/tfr.py/_centered