EconPapers    
Economics at your fingertips  
 

Optimizing Long Short -Term Memory (LSTM) Model Hyperparameters for Enhanced Stock Price Forecasting and Portfolio Allocation

Siqi Li ()
Additional contact information
Siqi Li: Haverford College, Department of Economics

A chapter in Proceedings of the International Workshop on Navigating the Digital Business Frontier for Sustainable Financial Innovation (ICDEBA 2024), 2025, pp 615-627 from Springer

Abstract: Abstract Due to the increasing application of Long Short-Term Memory (LSTM) models in stock price forecasting and portfolio allocation, it is crucial to tune the models for better accuracy. However, there is a limited study on how the hyperparameters of LSTM models affect the model performances. Therefore, this paper investigated the relationships between hyperparameters, particularly the number of neurons and LSTM layers, on the Mean Squared Error (MSE) of LSTM models. To shed light on practical significance, this research was conducted in the setting of portfolio optimization with a combination of LSTM stock price forecasting and Monte-Carlo Portfolio Simulation. More specifically, the LSTM model was first trained to forecast the weekly prices of five selected stocks, during which the MSE resulted from different number of neurons in the first LSTM layer as well as the total number of layers were compared. Following that, the combination of hyperparameters reaching the smallest MSE was selected for each stock, and the corresponding forecasted returns (calculated from the forecasted prices) were treated as input of the Monte-Carlo Simulation. Finally, the Monte-Carlo Simulation was employed for generating the desired portfolios. As the results demonstrated, the increase in number of layers in general leads to rising MSE, yet the increase in number of neurons in the first LSTM layer has either blurred effect or improving effects on model performances, depending on the original volatility of historical values.

Keywords: Long Short-Term Memory Model; Monte-Carlo Simulation; Stock Price Forecasting (search for similar items in EconPapers)
Date: 2025
References: Add references at CitEc
Citations:

There are no downloads for this item, see the EconPapers FAQ for hints about obtaining it.

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:spr:advbcp:978-94-6463-652-9_64

Ordering information: This item can be ordered from
http://www.springer.com/9789464636529

DOI: 10.2991/978-94-6463-652-9_64

Access Statistics for this chapter

More chapters in Advances in Economics, Business and Management Research from Springer
Bibliographic data for series maintained by Sonal Shukla () and Springer Nature Abstracting and Indexing ().

 
Page updated 2026-05-19
Handle: RePEc:spr:advbcp:978-94-6463-652-9_64