Forecasting by frequency interpolation of time series
The FITS algorithm propsed by Xu et.al in FITS: Modeling time series with 10k parameters, uses a neat trick from signal processing to forecasting.
The principle it exploits is: increasing the resolution in the frequency domain also increases the signal length in the time domain. In other words, longer time series provides a higher frequency resolution.
The algorithm extends the resolution of the power spectral density as follows:
- De-mean the time series by subtracting the mean. This gets rid of the DC component (the dominant zero-frequency amplitude in the PSD).
- Compute the real Fourier transform (rFFT) of the
time series getting back a complex valued signal.
- The rFFT condenses the length of the time series N to N/2+1 complex numbers.
- Learn the complex valued signal, the amplitude and
phase, using a linear layer with complex type.
- The layer has input size
F
and output sizeF * length_ratio
. Where,F
is the length of the complex valued signal andlength_ratio
is(sequence_length + prediction_length) * sequence_length
. Length ratio is therefore > 1 andF * length_ratio
is larger than the original frequency resolutionF
.
- The layer has input size
- Add back the mean to the predicted signal.
- Compute the inverse rFFT to get the predicted time series, which is now longer than the original time series.
The method is fast, because the FFT is fast, It is also memory efficient, because working in the frequency domain and using complex valued paramaters reduces the number of parameters to learn. A major benefit is the model supervises both the forecasting horizon but also backcasting on the look-back window. One concern is that the method does not do a good job at capturing the local-linear trends in the time series but should do a good job at capturing the periodicity.