
Table 5: Precision of ACF-LPA and other algorithms on synthetic datasets. The best results are highlighted in bold.
Algorithms ACFs
Synthetic Sinusoidal Time Series Synthetic Square Time Series Synthetic Triangle Time Series
OR = 0 OR = 0.01 OR = 0.03 OR = 0.05 OR = 0 OR = 0.01 OR = 0.03 OR = 0.05 OR = 0 OR = 0.01 OR = 0.03 OR = 0.05
ACF-LPA
RAW 0.091 0.090 0.068 0.062 0.235 0.233 0.178 0.153 0.071 0.077 0.059 0.047
M-RAW 0.096 0.120 0.164 0.182 0.250 0.288 0.322 0.343 0.075 0.097 0.113 0.134
MA 0.778 0.285 0.102 0.057 1.000 0.804 0.319 0.171 0.715 0.239 0.074 0.036
M-MA 0.881 0.935 0.922 0.862 0.998 0.993 0.992 0.985 0.841 0.903 0.852 0.724
PAL M-MA 0.880 0.891 0.722 0.576 0.954 0.875 0.763 0.657 0.836 0.838 0.650 0.462
Fisher’s Test 0.212 0.217 0.207 0.208 0.267 0.273 0.269 0.265 0.172 0.173 0.171 0.179
Lomb–Scargle 0.483 0.480 0.462 0.477 0.646 0.638 0.606 0.609 0.391 0.393 0.382 0.375
findfrequency 0.431 0.356 0.287 0.216 0.516 0.454 0.365 0.287 0.351 0.291 0.200 0.168
outliers, M-MA ACF performance slightly trails MA
ACF in synthetic square wave datasets, though it re-
mains competitive. However, for synthetic sinusoidal
and triangle wave datasets, M-MA ACF performs
best. When outliers are present, especially in larger
ratios, M-MA ACF significantly outperforms other
ACFs in accuracy. In the left peak analysis ablation
study, we juxtapose our algorithm with PAL’s sea-
sonality using M-MA ACF. Without outliers, our al-
gorithm holds its own against PAL. However, when
outliers are present, our algorithm outpaces PAL,
with the advantage becoming more pronounced as the
number of outliers increases.
The experimental results from both the CRAN and
synthetic datasets demonstrate that the M-MA ACF-
LPA algorithm outperforms or matches other algo-
rithms when no outliers are present. Furthermore, the
presence of outliers significantly enhances the superi-
ority of the M-MA ACF-LPA, with its advantage be-
coming increasingly evident as the number of outliers
increases.
5 CONCLUSIONS
In this paper, we present a novel robust autocorrela-
tion function, M-MA ACF, designed for period detec-
tion in time series data. This function, derived from
moving average and applying MAD filter to every
cycle-subseries, exhibits robustness against both iso-
lated and consecutive outliers. This robustness is sub-
stantiated through theoretical analysis and empirical
testing on both real-world and synthetic datasets. M-
MA ACF can enhance the performance of existing al-
gorithms like PAL’s seasonality test, ACF-Med, AU-
TOPERIOD, and SAZED. We also introduce a new
algorithm, M-MA ACF-LPA, that builds on M-MA
ACF and left peak analysis. Without outliers, the per-
formance of the M-MA ACF-LPA algorithm is on par
with or better than other algorithms in comparison.
The presence of outliers, however, accentuates its su-
periority, with its advantage increasing proportional
to the number of outliers. Although our proposed
ACFs have a complexity of O(N
2
), parallel compu-
tation can be deployed for process optimization. Be-
sides, our proposed ACF has the potential to improve
the accuracy of many existing algorithms, and thus
benefit various related applications.
REFERENCES
Breitenbach, T., Wilkusz, B., Rasbach, L., and Jahnke, P.
(2023). On a method for detecting periods and re-
peating patterns in time series data with autocorrela-
tion and function approximation. Pattern Recognition,
138:109355.
Buades, A., Coll, B., and Morel, J.-M. (2005). A non-local
algorithm for image denoising. In 2005 IEEE com-
puter society conference on computer vision and pat-
tern recognition (CVPR’05), volume 2, pages 60–65.
IEEE.
Cleveland, R. B., Cleveland, W. S., McRae, J. E., and Ter-
penning, I. (1990). Stl: A seasonal-trend decomposi-
tion. J. Off. Stat, 6(1):3–73.
Fisher, R. A. (1929). Tests of significance in harmonic anal-
ysis. Proceedings of the Royal Society of London.
Series A, Containing Papers of a Mathematical and
Physical Character, 125(796):54–59.
Gao, J., Song, X., Wen, Q., Wang, P., Sun, L., and Xu,
H. (2020). Robusttad: Robust time series anomaly
detection via decomposition and convolutional neural
networks. arXiv preprint arXiv:2002.09545.
Glynn, E. F., Chen, J., and Mushegian, A. R. (2006). Detect-
ing periodic patterns in unevenly spaced gene expres-
sion time series using lomb–scargle periodograms.
Bioinformatics, 22(3):310–316.
Hu, F., Smeaton, A. F., and Newman, E. (2014). Periodic-
ity detection in lifelog data with missing and irregu-
larly sampled data. In 2014 IEEE International Con-
ference on Bioinformatics and Biomedicine (BIBM),
pages 16–23. IEEE.
Hyndman, R. (2018). Forecasting: principles and practice.
OTexts.
Hyndman, R. J. (2023). findfrequency: Find dominant fre-
quency of a time series.
Hyndman, R. J. and Killick, R. (2023). Cran task view:
Time series analysis.
Lomb, N. R. (1976). Least-squares frequency analysis of
unequally spaced data. Astrophysics and space sci-
ence, 39:447–462.
Robust Autocorrelation for Period Detection in Time Series
43