autocorrelation#

pytorch_forecasting.utils._utils.autocorrelation(input, dim=0)[source]#

Computes the autocorrelation of samples at dimension dim.

Reference: https://en.wikipedia.org/wiki/Autocorrelation#Efficient_computation

Implementation copied from pyro.

Parameters:
  • input (torch.Tensor) – The input tensor.

  • dim (int, optional) – The dimension to calculate autocorrelation. Defaults to 0.

Returns:

Autocorrelation of input.

Return type:

torch.Tensor