Comparative Analysis of Activation Functions in LSTM Models for Predicting Bank BNI Stock Prices

https://doi.org/10.47194/ijgor.v6i3.396

Authors

  • Astrid Sulistya Azahra Master's Program of Mathematics, Faculty of Mathematics and Natural Sciences, Universitas Padjadjaran, Jatinangor, West Java, Indonesia
  • Moch Panji Agung Saputra Department of Mathematics, Faculty of Mathematics and Natural Sciences, Universitas Padjadjaran, Sumedang 45363, Indonesia
  • Rizki Apriva Hidayana Doctoral of Mathematics Study Program, Faculty of Mathematics and Natural Sciences, Universitas Padjadjaran, Sumedang 45363, Indonesia

Keywords:

Stock prediction, BNI bank, activation function, LSTM, deep learning

Abstract

The Indonesian capital market has experienced rapid development in the last two decades, with the banking sector as one of the main drivers. Stock price prediction is a crucial aspect for investors and market players to minimize risk and optimize investment strategies. Price fluctuations influenced by fundamental factors, market sentiment, and external conditions make prediction a complex challenge. This study aims to compare the performance of four activation functions: Rectified Linear Unit (ReLU), hyperbolic tangent (Tanh), Sigmoid, and Softplus, in the Long Short-Term Memory (LSTM) model in predicting the stock price of Bank Negara Indonesia (BNI). The method used is a quantitative approach with experiments, using historical data of BNI's closing stock prices for the period May 1, 2020, to April 30, 2025, obtained from Yahoo Finance. The data is processed through cleaning, normalization, transformation into a supervised learning format, and division into training data (80%) and test data (20%). Performance evaluation is carried out using RMSE, MAE, MAPE, and R² metrics. The results showed that the Softplus activation function produced the best performance with RMSE 128.714, MAE 101.815, MAPE 2.358%, and R² 0.924, followed by ReLU which had competitive performance and more efficient training time. The Tanh activation function was in the middle position, while Sigmoid showed the lowest performance. These findings indicate that Softplus and ReLU are optimal choices for BNI stock price prediction using LSTM, with Softplus excelling in accuracy and ReLU providing a balance between performance and efficiency.

Published

2025-08-25