Circular Bootstrap on Residuals for Interval Forecasting in K-NN Regression: A Case Study on Durian Exports

Main Article Content

Parattakorn Kamlangdee
Patchanok Srisuradetchai

Abstract

Traditional k-nearest neighbor (K-NN) methods for time series forecasting often fail to capture prediction uncertainty. This study addresses this limitation by integrating circular bootstrap on residuals with K-NN regression to forecast Thailand’s monthly durian export volumes, which exhibit strong non-linearity and seasonality. The proposed methodology includes data scaling and explicit seasonality handling. Circular bootstrap generates multiple residual samples, constructing forecast intervals that quantify uncertainty while preserving temporal dependencies. Comparative analysis demonstrates that the proposed method outperforms the seasonal autoregressive integrated moving average (SARIMA) and exponential smoothing state space (ETS) models by producing forecast intervals that are, on average, 20% narrower. However, coverage is slightly lower, with actual values falling within the intervals in 11 out of 12 months, compared to full coverage by SARIMA and ETS. The results highlight the potential of combining statistical resampling with machine learning to enhance K-NN forecasting, offering a practical solution for improving time series forecast reliability, as demonstrated in the case study of Thailand’s durian exports.

Article Details

How to Cite
Parattakorn Kamlangdee, & Patchanok Srisuradetchai. (2025). Circular Bootstrap on Residuals for Interval Forecasting in K-NN Regression: A Case Study on Durian Exports. Science & Technology Asia, 30(1), 79–94. retrieved from https://ph02.tci-thaijo.org/index.php/SciTechAsia/article/view/255306
Section
Physical sciences

References

Tajmouati S, Wahbi BEL, Bedoui A, Abarda A, Dakkon M. Applying knearest neighbors to time series forecasting: Two new approaches. J Forecasting. 2024 Feb;1:1–16.

Martínez F, Frías MP, Pérez MD, Rivera AJ. A methodology for applying knearest neighbor to time series forecasting. Artif Intell Rev. 2019;52(3):2019–37.

Zhang N, Lin A, Shang P. Multidimensional k-nearest neighbor model based on EEMD for financial time series forecasting. Physica A: Stat Mech Appl. 2017;477:161–73.

Tang L, Pan H, Yao Y. K-Nearest Neighbor Regression with Principal Component Analysis for Financial Time Series Prediction. ICCAI '18: Proceedings of the 2018 International Conference on Computing and Artificial Intelligence. 2018;127–31.

Liu Q, Liu C. A Novel Locally Linear KNN Method With Applications to Visual Recognition. IEEE Trans Neural Netw Learn Syst. 2017 Sep;28(9):2010–21.

Ni KS, Nguyen TQ. An adaptable knearest neighbors algorithm for MMSE image interpolation. IEEE Trans Image Process. 2009 Sep;18(9):1976–87.

Martínez F, Frías MP, Pérez-Godoy MD, Rivera AJ. Dealing with seasonality by narrowing the training set in time series forecasting with kNN. Expert Syst Appl. 2018 Mar;103:38–48.

Martínez-Álvarez F, Troncoso A, Riquelme JC, Aguilar-Ruiz JS. Energy time series forecasting based on pattern sequence similarity. IEEE Trans Knowl Data Eng. 2011 Sep;23(8):1230–43.

Srisuradetchai P, Panichkitkosolkul W. Using ensemble machine learning methods to forecast particulate matter (PM2.5) in Bangkok, Thailand. In: Multidisciplinary Trends in Artificial Intelligence: 15th International Conference, MIWAI 2022, Virtual Event, November 17- 19, 2022, Proceedings. 2022 Nov. p. 204–15.

Troncoso A, Riquelme Santos JM, Gomez-Exposito A, Martinez-Ramos JL. Electricity market price forecasting based on weighted nearest neighbors techniques. IEEE Trans Power Syst. 2007 Sep;22(3):1294–301.

Srisuradetchai P. A novel interval forecast for k-nearest neighbor time series: A case study of durian export in Thailand. IEEE Access. 2024;12:2032–44.

Fernández-Rodríguez F, Sosvilla-Rivero S, Andrada-Félix J. Nearest-neighbour predictions in foreign exchange markets. In: Chen SH, Wang PP, editors. Computational Intelligence in Economics and Finance. Berlin, Heidelberg: Springer; 2004. p. 193–207.

Martínez F, Frías MP, Charte F, Rivera AJ. Time series forecasting with KNN in R: The tsfknn package. The R Journal. 2019;11(2):229-42.

Srisuradetchai P, Phaphan W. Using Monte-Carlo dropout in deep neural networks for interval forecasting of durian export. WSEAS Trans Syst Control. 2024;19:10–21.

Kück M, Freitag M. Forecasting of customer demands for production planning by local k-nearest neighbor models. Int J Prod Econ. 2021;231:107837.

Lee WM. Python machine learning. 1st ed. Wiley; 2019 Apr. ISBN: 978-1119545637.

Narejo S, Jawaid MM, Talpur S, Baloch R, Pasero EGA. Multi-step rainfall forecasting using deep learning approach. PeerJ Comput Sci. 2021;7:e514.

Panichkitkosolkul W, Srisuradetchai P. Bootstrap confidence intervals for the parameter of zero-truncated Poisson-Ishita distribution. Thailand Statistician. 2022 Oct;20(4):918–27.

Kummaraka U, Srisuradetchai P. Timeseries interval forecasting with dualoutput Monte Carlo dropout: A case study on durian exports. Forecasting. 2024 Sep;6(3):616–36.

Efron B, Tibshirani RJ. An introduction to the bootstrap. 1st ed. Boca Raton, FL, USA: Chapman & Hall/CRC; 1993.

Politis DN, Romano JP. The stationary bootstrap. J Am Stat Assoc. 1994 Dec;89(428):1303–13.

Lahiri SN. Resampling methods for dependent data. New York, NY, USA: Springer-Verlag; 2003. p. 1–374.

Davison AC, Hinkley DV. Bootstrap methods and their application. Cambridge, U.K.: Cambridge University Press; 1997.

Härdle W, Horowitz J, Kreiss JP. Bootstrap methods for time series. Int Stat Rev. 2013 Aug;71(2):435–59.

Shao X, Politis DN. The dependent wild bootstrap. J Am Stat Assoc. 2010 Mar;105(489):218–35.

Bühlmann P, Künsch HR. Block length selection in the bootstrap for time series. Comput Stat Data Anal. 1999 Sep;31(3):295–310.

Hyndman RJ, Athanasopoulos G. Forecasting: Principles and Practice. 2nd ed. Melbourne, Australia: OTexts; 2018.

Available from: https://otexts.com/fpp2[Accessed 2024 Jun 24].

Micchelli CA, Pontil M. On learning vector-valued functions. Neural Comput. 2005 Jan;17(1):177–204.

Taieb SB, Bontempi G, Sorjamaa A, Lendasse A. Long-term prediction of time series by combining direct and MIMO strategies. In: 2009 International Joint Conference on Neural Networks; 2009 Jun 14-19; Atlanta, GA, USA. IEEE; 2009. p. 3054–61.

Box GEP, Jenkins GM, Reinsel GC. Time series analysis: Forecasting and control. 1st ed. Hoboken, NJ, USA: Wiley; 2008. p. 1–784.

Gel YR, Lyubchich V, Ramirez Ramirez LL. Bootstrap quantification of estimation uncertainties in network degree distributions. Sci Rep. 2017;7:5807.

de Luna X, Johansson P, Sjostedt-de Luna S. Bootstrap inference for k-nearest neighbour matching estimators. IZA Discussion Paper No. 5361. 2010. Available from: https://ssrn.com/abstract-=1723999.

Srisuradetchai P, Suksrikran K. Random kernel k-nearest neighbors regression. Front Big Data. 2024;7:1402384.

Huadsri S, Phaphan W. The development of forecasting models for life insurance data by employing time-series analysis and machine learning techniques. WSEAS Trans Math. 2024;23.

Simmachan T, Manopa W, Neamhom P, Poothong A, Phaphan W. Detecting fraudulent claims in automobile insurance policies by data mining techniques. Thailand Statistician. 2023 Jul;21(3): 552–68.

De Myttenaere A, Golden B, Le Grand B, Rossi F. Mean absolute percentage error for regression models. Neurocomputing. 2016;192:38–48.

Kummaraka U, Srisuradetchai P. Interval estimation of the dependence parameter in bivariate Clayton copulas. Emerg Sci J. 2023 Oct;7(5):1478–90.

Srisuradetchai P, Dangsupa K. On interval estimation of the geometric parameter in a zero-inflated geometric distribution. Thailand Statistician. 2023;21(1):93–109.

Løhre E, Juanchich M, Sirota M, Teigen KH, Shepherd TG. Climate scientists’ wide prediction intervals may be more likely but are perceived to be less certain. Weather Clim Soc. 2019 Jul;11(3):565–75.

Zhang P, Liu S, Lu D, Zhang G, Sankaran R. A prediction interval method for uncertainty quantification of regression models. In: Ninth International Conference on Learning Representations (ICLR); 2021 May; Virtual Conference. OSTI ID: 1785172.

Huang YC, Padarian J, Minasny B, McBratney AB. Using Monte Carlo conformal prediction to evaluate the uncertainty of deep learning soil spectral models. EGUsphere [Preprint]. 2025.

Chen KY, Wang CH. A hybrid SARIMA and support vector machines in forecasting the production values of the machinery industry in Taiwan. Expert Syst Appl. 2007;32(1):254–64.

Kalyan R, Nayak SYH, Pavitra R, Tripathy K, Prathyusha K. Forecasting foreign currency exchange price using long short-term memory with k-nearest neighbor method. Int J Eng Adv Technol. 2019. Available from: https://api.semanticscholar. org/CorpusID:242676291.

Ialongo C. Confidence interval for quantiles and percentiles. Biochem Med (Zagreb). 2019;29:010101.

Flowers-Cano RS, Ortiz-Gómez R, León-Jiménez JE, López Rivera R, Perera Cruz LA. Comparison of bootstrap confidence intervals using Monte Carlo simulations. Water. 2018;10(2):166.

Tarr G. Small sample performance of quantile regression confidence intervals. J Stat Comput Simul. 2011;82(1):81–94.

Diciccio TJ, Romano JP. A review of bootstrap confidence intervals. J R Stat Soc Ser B (Methodol). 1989 Jul;51(3):470.