XGBoost Forecasting of NEPSE Index Log Returns with Walk Forward Validation

ArXiv ID: 2601.08896 “View on arXiv”

Authors: 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.

Keywords: XGBoost, Optuna, Walk-forward Validation, Technical Indicators, Time-series Cross-validation, Equities

Complexity vs Empirical Score

  • Math Complexity: 4.0/10
  • Empirical Rigor: 8.5/10
  • Quadrant: Street Traders
  • Why: The paper uses standard ML techniques (XGBoost, ARIMA, Ridge) with accessible feature engineering, showing low-to-moderate mathematical density. However, it demonstrates high empirical rigor through rigorous walk-forward validation, hyperparameter optimization (Optuna), and detailed backtest-ready metrics (RMSE, MAE, directional accuracy) on real historical data.
  flowchart TD
    A["Research Goal: Develop a robust ML framework for one-step-ahead forecasting of NEPSE daily log-returns"] --> B["Data & Feature Engineering"]
    B --> C["Model Optimization"]
    C --> D["Validation Strategy"]
    D --> E["Key Outcomes"]

    subgraph B ["Data & Feature Engineering"]
        B1["NEPSE Index Historical Data"]
        B2["Engineered Features: Lagged returns (up to 30 days),<br>Rolling Volatility, RSI (14-period)"]
    end

    subgraph C ["Model Optimization"]
        C1["XGBoost Regressor"]
        C2["Hyperparameter Tuning via Optuna<br>using Time-Series CV"]
    end

    subgraph D ["Validation Strategy"]
        D1["Walk-Forward Validation<br>Expanding & Rolling Windows"]
        D2["Benchmarks: ARIMA & Ridge Regression"]
    end

    subgraph E ["Key Outcomes"]
        E1["Optimal Config: Expanding Window, 20 Lags"]
        E2["Superior Performance vs. Benchmarks<br>Lowest RMSE (0.013450) & MAE (0.009814)"]
        E3["65.15% Directional Accuracy"]
        E4["Feature Importance Analysis for Interpretability"]
    end