code: def autocorrelation(self, x, lag):
          
          # This is important: If a series is passed, the product below is calculated
          # based on the index, which corresponds to squaring the series.
          if lag is None:
              lag = 0
          _autoc = feature_calculators.autocorrelation(x, lag)
          logging.debug("autocorrelation by tsfresh calculated")
          return _autoc
docs: As in tsfresh `autocorrelation <https://github.com/blue-yonder/tsfresh/blob/master/tsfresh/feature_extraction/\
          feature_calculators.py#L1457>`_
  
          Calculates the autocorrelation of the specified lag, according to the `formula <https://en.wikipedia.org/wiki/\
          Autocorrelation#Estimation>`_:
          
          .. math::
              
              \\frac{1}{(n-l)\sigma^{2}} \\sum_{t=1}^{n-l}(X_{t}-\\mu )(X_{t+l}-\\mu)
          
          where :math:`n` is the length of the time series :math:`X_i`, :math:`\sigma^2` its variance and :math:`\mu` its
          mean. `l` denotes the lag.
  
          :param x: the time series to calculate the feature of
          :type x: pandas.Series
          :param lag: the lag
          :type lag: int
          :return: the value of this feature
          :rtype: float