autocorrelation#

pytorch_forecasting.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 form pyro.

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

  • dim (int) – the dimension to calculate autocorrelation.

Returns torch.Tensor:

autocorrelation of input.