IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2601.08896.html

XGBoost Forecasting of NEPSE Index Log Returns with Walk Forward Validation

Author

Listed:
  • Sahaj Raj Malla
  • Shreeyash Kayastha
  • Rumi Suwal
  • Harish Chandra Bhandari
  • Rajendra Adhikari

Abstract

This study develops a robust machine learning framework for one-step-ahead forecasting of daily log-returns in the Nepal Stock Exchange (NEPSE) Index using the XGBoost regressor. A comprehensive feature set is engineered, including lagged log-returns (up to 30 days) and established technical indicators such as short- and medium-term rolling volatility measures and the 14-period Relative Strength Index. Hyperparameter optimization is performed using Optuna with time-series cross-validation on the initial training segment. Out-of-sample performance is rigorously assessed via walk-forward validation under both expanding and fixed-length rolling window schemes across multiple lag configurations, simulating real-world deployment and avoiding lookahead bias. Predictive accuracy is evaluated using root mean squared error, mean absolute error, coefficient of determination (R-squared), and directional accuracy on both log-returns and reconstructed closing prices. Empirical results show that the optimal configuration, an expanding window with 20 lags, outperforms tuned ARIMA and Ridge regression benchmarks, achieving the lowest log-return RMSE (0.013450) and MAE (0.009814) alongside a directional accuracy of 65.15%. While the R-squared remains modest, consistent with the noisy nature of financial returns, primary emphasis is placed on relative error reduction and directional prediction. Feature importance analysis and visual inspection further enhance interpretability. These findings demonstrate the effectiveness of gradient boosting ensembles in modeling nonlinear dynamics in volatile emerging market time series and establish a reproducible benchmark for NEPSE Index forecasting.

Suggested Citation

  • Sahaj Raj Malla & Shreeyash Kayastha & Rumi Suwal & Harish Chandra Bhandari & Rajendra Adhikari, 2026. "XGBoost Forecasting of NEPSE Index Log Returns with Walk Forward Validation," Papers 2601.08896, arXiv.org.
  • Handle: RePEc:arx:papers:2601.08896
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2601.08896
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Bergmeir, Christoph & Hyndman, Rob J. & Koo, Bonsoo, 2018. "A note on the validity of cross-validation for evaluating autoregressive time series prediction," Computational Statistics & Data Analysis, Elsevier, vol. 120(C), pages 70-83.
    2. Keshab Raj Dahal & Ankrit Gupta & Nawa Raj Pokhrel, 2024. "Predicting the Direction of NEPSE Index Movement with News Headlines Using Machine Learning," Econometrics, MDPI, vol. 12(2), pages 1-26, June.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Qi Guo & Bruno Remillard & Anatoliy Swishchuk, 2020. "Multivariate General Compound Point Processes in Limit Order Books," Risks, MDPI, vol. 8(3), pages 1-20, September.
    2. Henriques, Irene & Sadorsky, Perry, 2023. "Forecasting rare earth stock prices with machine learning," Resources Policy, Elsevier, vol. 86(PA).
    3. Philippe Goulet Coulombe & Maxime Leroux & Dalibor Stevanovic & Stéphane Surprenant, 2022. "How is machine learning useful for macroeconomic forecasting?," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 37(5), pages 920-964, August.
    4. Hewamalage, Hansika & Bergmeir, Christoph & Bandara, Kasun, 2021. "Recurrent Neural Networks for Time Series Forecasting: Current status and future directions," International Journal of Forecasting, Elsevier, vol. 37(1), pages 388-427.
    5. Gary S. Anderson & Alena Audzeyeva, 2019. "A Coherent Framework for Predicting Emerging Market Credit Spreads with Support Vector Regression," Finance and Economics Discussion Series 2019-074, Board of Governors of the Federal Reserve System (U.S.).
    6. Thomas Despois & Catherine Doz, 2022. "Identifying and interpreting the factors in factor models via sparsity : Different approaches," Working Papers halshs-03626503, HAL.
    7. Ioannis Kyriakou & Parastoo Mousavi & Jens Perch Nielsen & Michael Scholz, 2021. "Short-Term Exuberance and Long-Term Stability: A Simultaneous Optimization of Stock Return Predictions for Short and Long Horizons," Mathematics, MDPI, vol. 9(6), pages 1-19, March.
    8. Richard Schnorrenberger & Aishameriane Schmidt & Guilherme Valle Moura, 2024. "Harnessing Machine Learning for Real-Time Inflation Nowcasting," Working Papers 806, DNB.
    9. Tomáš Plíhal, 2021. "Scheduled macroeconomic news announcements and Forex volatility forecasting," Journal of Forecasting, John Wiley & Sons, Ltd., vol. 40(8), pages 1379-1397, December.
    10. Huber, Jakob & Stuckenschmidt, Heiner, 2020. "Daily retail demand forecasting using machine learning with emphasis on calendric special days," International Journal of Forecasting, Elsevier, vol. 36(4), pages 1420-1438.
    11. Georgia Koppe & Hazem Toutounji & Peter Kirsch & Stefanie Lis & Daniel Durstewitz, 2019. "Identifying nonlinear dynamical systems via generative recurrent neural networks with applications to fMRI," PLOS Computational Biology, Public Library of Science, vol. 15(8), pages 1-35, August.
    12. Steven Y. K. Wong & Jennifer Chan & Lamiae Azizi & Richard Y. D. Xu, 2020. "Time-varying neural network for stock return prediction," Papers 2003.02515, arXiv.org, revised Jan 2021.
    13. Arthur Charpentier & Molly James & Hani Ali, 2021. "Predicting Drought and Subsidence Risks in France," Papers 2107.07668, arXiv.org.
    14. Yang Sheng & Weizhong Liu & Hailiang Xu & Xianchao Gao, 2021. "The Spatial Distribution Characteristics of the Cultivated Land Quality in the Diluvial Fan Terrain of the Arid Region: A Case Study of Jimsar County, Xinjiang, China," Land, MDPI, vol. 10(9), pages 1-29, August.
    15. Zhentao Shi & Yishu Wang, 2025. "L2-relaxation for Economic Prediction," Papers 2510.12183, arXiv.org.
    16. Van Belle, Jente & Guns, Tias & Verbeke, Wouter, 2021. "Using shared sell-through data to forecast wholesaler demand in multi-echelon supply chains," European Journal of Operational Research, Elsevier, vol. 288(2), pages 466-479.
    17. DeMiguel, Victor & Gil-Bazo, Javier & Nogales, Francisco J. & Santos, André A.P., 2023. "Machine learning and fund characteristics help to select mutual funds with positive alpha," Journal of Financial Economics, Elsevier, vol. 150(3).
    18. Pellegrino, Filippo, 2025. "Selecting time-series hyperparameters with the artificial jackknife," Computational Statistics & Data Analysis, Elsevier, vol. 209(C).
    19. Paap, Richard & Franses, Philip Hans, 2025. "Shrinkage estimators for periodic autoregressions," Journal of Econometrics, Elsevier, vol. 247(C).
    20. Riste Ichev & Rok Spruk, 2026. "Pricing Catastrophe: How Extreme Political Shocks Reprice Sovereign Risk, Beliefs, and Growth Expectations," Papers 2601.20724, arXiv.org.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2601.08896. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.