Stock price prediction is a crucial task in financial analysis, where deep learning models such as Transformers play a significant role. This study evaluates the performance of the Vanilla Transformer and Informer models using three different loss functions: MSE, Huber Loss, and Log-Cosh Loss. The results show that for the Vanilla Transformer, Log-Cosh Loss achieves the lowest RMSE (0.1097) while maintaining the fastest training time (56.93 s) and the lowest memory usage (4837.03 MB), making it the most efficient choice. However, Huber Loss provides the highest R2 value (0.8207), indicating a better fit to actual data. For the Informer model, Huber Loss outperforms the other loss functions, producing the lowest RMSE (0.0956) and the highest R2 (0.8485) despite requiring slightly more training time (89.96 s). Meanwhile, Log-Cosh Loss, although the fastest in training (86.46 s), has the highest RMSE (0.1357) and the lowest R2 (0.6952), making it less suitable for accurate predictions. Predictive accuracy and computational efficiency depend heavily on selecting an appropriate loss function. The Log-Cosh Loss delivers the most suitable result for Vanilla Transformers but Huber Loss stands as the best solution for Informer models because of its enhanced accuracy and low memory requirements. The selection of appropriate loss functions enhances deep learning models for financial forecasting because it produces these results.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Understanding Stock Trend Prediction: Comparing Vanilla Transformer and Informer Models Using MSE, Huber Loss, and Log-Cosh

  • Asriana,
  • Muharman Lubis,
  • Hanif Fakhurroja,
  • Putri Utami Rukmana,
  • Nathifa Agustiana,
  • Anggraeni Xena Pradita

摘要

Stock price prediction is a crucial task in financial analysis, where deep learning models such as Transformers play a significant role. This study evaluates the performance of the Vanilla Transformer and Informer models using three different loss functions: MSE, Huber Loss, and Log-Cosh Loss. The results show that for the Vanilla Transformer, Log-Cosh Loss achieves the lowest RMSE (0.1097) while maintaining the fastest training time (56.93 s) and the lowest memory usage (4837.03 MB), making it the most efficient choice. However, Huber Loss provides the highest R2 value (0.8207), indicating a better fit to actual data. For the Informer model, Huber Loss outperforms the other loss functions, producing the lowest RMSE (0.0956) and the highest R2 (0.8485) despite requiring slightly more training time (89.96 s). Meanwhile, Log-Cosh Loss, although the fastest in training (86.46 s), has the highest RMSE (0.1357) and the lowest R2 (0.6952), making it less suitable for accurate predictions. Predictive accuracy and computational efficiency depend heavily on selecting an appropriate loss function. The Log-Cosh Loss delivers the most suitable result for Vanilla Transformers but Huber Loss stands as the best solution for Informer models because of its enhanced accuracy and low memory requirements. The selection of appropriate loss functions enhances deep learning models for financial forecasting because it produces these results.