Genetic Algorithm and LSTM Artificial Neural Network for Investment Portfolio Optimization
Gustavo A. Flores-FernandezGraduate from the Faculty of Industrial Engineering at the Universidad Nacional De Piura, Perú. fgustavoalexis@gmail.com0000-0002-4488-4325
Miguel Jimenez-CarrionProfessor, Facultad De Ingeniería Industrial, Universidad Nacional De Piura, Castilla-Piura, Perú. mjimenezc@unp.edu.pe0000-0001-9632-5085
Flabio GutierrezProfessor, Universidad Nacional De Piura, Piura, Perú. flabio@unp.edu.pe0000-0003-0372-3864
Raul A. Sanchez-AncajimaProfessor, Universidad Nacional De Tumbes, Tumbes, Perú. rsanchez@untumbes.edu.pe0000-0003-3341-7382
The present research aimed to construct a genetic algorithm and artificial neural network to optimize investment portfolios, considering that in modern investment portfolio theory, optimization is a multi-objective problem involving maximizing return and minimizing volatility, also known as risk. This opens up the possibility of a highly combinatorial solution space, making it a computationally complex problem that cannot be solved by deterministic algorithms. To achieve the objective, 255 companies operating within the Peruvian national market and listed on the Lima Stock Exchange were evaluated. The research resulted in a mean squared error of 6.33%, a mean absolute error of 5.07%, and an accuracy of 92.35% related to the artificial neural network, indicating an acceptable generalization capacity for predicting positive trends in the stocks to be used as inputs for the genetic algorithm. Regarding the genetic algorithm, a quality function was successfully modeled, considering 5 factors related to the profitability and volatility of the stocks, as well as portfolio diversification. Ultimately, the best configuration of the genetic algorithm was found to have a fitness value of 0.772482, translating to a return of 1.00058% and volatility of 0.00612%. It is concluded that the genetic algorithm optimizes investment portfolios by achieving higher returns and lower volatility compared to other methods, with volatility specifically being a much lower percentage.