Stock price prediction is a challenging research domain. The long short-term memory neural network (LSTM) widely employed in stock price prediction due to its ability to address long-term dependence and transmission of historical time signals in time series data. However, manual tuning of LSTM parameters significantly impacts model performance. PSO-LSTM model leveraging PSO's efficient swarm intelligence and strong optimization capabilities is proposed in this article. The experimental results on six global stock indices demonstrate that PSO-LSTM effectively fits real data, achieving high prediction accuracy. Moreover, increasing PSO iterations lead to gradual loss reduction, which indicates PSO-LSTM's good convergence. Comparative analysis with seven other machine learning algorithms confirms the superior performance of PSO-LSTM. Furthermore, the impact of different retrospective periods on prediction accuracy and finding consistent results across varying time spans are. Conducted in the experiments.
Copyright: © 2025 Zeng et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.