COMPARATIVE ANALYSIS OF LONG SHORT-TERM MEMORY (LSTM) AND GATED RECURRENT UNIT (GRU) MODELS FOR DAILY STOCK CLOSING-PRICE FORECASTING
Abstract
Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) networks are widely reported to forecast stock prices accurately, yet published comparisons of the two rarely hold the experimental setup constant, and few evaluate them against a naive random-walk forecast. This paper compares the two architectures on eight equities listed on the Nigerian Exchange Group (NGX), namely Access Holdings, Airtel Africa, BUA Foods, Dangote Cement, Guaranty Trust Holding Company, MTN Nigeria, Seplat Energy and Zenith Bank, using 2,500 daily sessions per equity from January 2016 to August 2025. Preprocessing, chronological data splits, scaling, hyperparameters, random seeds and stopping rules were identical for both architectures, so that differences in outcome are attributable to architecture rather than to setup. Models were evaluated with univariate and multivariate inputs at one-day, five-day and twenty-day horizons, compared with naive and ARIMA benchmarks, and tested with the Diebold-Mariano test under Holm correction, walk-forward validation and volatility-regime analysis. An audit of the supplied data found that its normalised columns had been scaled over all equities and the whole period, which leaks test information into training, and these were replaced with per-equity scaling fitted on training data only. The GRU achieved the lower RMSE in 41 of 48 equity, input and horizon settings and was significantly more accurate in 21 of them against one for the LSTM. It carried 25 per cent fewer parameters, trained about 7 per cent faster per epoch, stopped earlier and was roughly twice as stable across seeds. Neither network, however, was more accurate than the naive forecast at any horizon, in any volatility regime or in any walk-forward fold, and directional accuracy never differed significantly from 50 per cent. A supplementary experiment that expressed the target relative to the latest price made the two architectures statistically indistinguishable and brought both to parity with the random walk, which shows that the GRU advantage reflects robustness to distribution shift rather than superior predictive structure. The paper recommends the GRU where a recurrent network must be chosen and argues that no NGX forecasting claim should be accepted without a naive benchmark and a formal test of predictive accuracy.