簡易檢索 / 詳目顯示

研究生: 李盈瑩
Li, Ying-Ying
論文名稱: 使用技術指標和皮爾森相關分析進行基於深度學習的股價預測-以台灣50為例
Deep Learning-Based Stock Price Prediction Using Technical Indicators and Pearson Correlation Analysis in the case of Taiwan ETF50 Stock
指導教授: 陳牧言
Chen, Mu-Yen
學位類別: 碩士
Master
系所名稱: 工學院 - 工程科學系碩士在職專班
Department of Engineering Science (on the job class)
論文出版年: 2024
畢業學年度: 112
語文別: 中文
論文頁數: 77
中文關鍵詞: 股市預測深度學習皮爾森系數時間序列預測
外文關鍵詞: Stock market prediction, Deep learning, Pearson coefficient, Time series forecasting
相關次數: 點閱:109下載:27
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 本研究採用了循環神經網路(Recurrent Neural Network, RNN)、長短期記憶網路(Long Short-Term Memory, LSTM)、雙向長短期記憶網路(Bidirectional Long Short-Term Memory, BiLSTM)、門控循環單元(Gated Recurrent Unit, GRU)、以及一維卷積神經網路(1-Dimensional Convolutional Neural Network, 1D CNN)五種深度學習模型來預測元大台灣50(ETF0050)的股價。研究收集了2013年1月至2023年1月的十年股票資料作為資料集,並結合多項技術指標與指數指標的相關性進行分析,以評估這些指標與收盤價之間的關係。使用皮爾森相關係數,將相關性分為五個級別:完全相關、高度相關、中度相關、低度相關以及微弱或無相關。接著,將數據分配為80%的訓練集和20%的測試集,並運用移動窗口法來進行後續分析。
    依股市的五個基本資料維度:開盤價、收盤價、最高價、最低價和交易量,設計了三種實驗設置:實驗1使用了開盤價、收盤價、最高價、最低價和交易量;實驗2剔除了交易量,基於其與收盤價的相關性較低;而實驗3則用調整後收盤價替換了交易量。這三種設置將分別與不同的技術指標組合(根據皮爾森相關性排序)進行配對,因此每個深度學習模型形成15種不同的實驗組合。本研究旨在比較這些組合在股價預測中的誤差率,以評估不同技術指標組合的預測效力。
    實驗結果指出,在實驗2和實驗3中,大多數深度學習模型在完全相關和高度相關情境下呈現相對低的預測錯誤率。其中,GRU模型在實驗2的高度相關情境下表現最佳,MSE為2.3314、MAE為1.1531、MAPE為0.0092。
    透過混淆矩陣進行模型評估,實驗2和實驗3結合皮爾森相關係數分析的高度正相關情境下,多數深度學習模型均呈現更高的準確率。其中,LSTM模型在實驗2中的高度相關情境下表現較好,準確率0.629、精確率0.603、召回率0.639,F1-score為0.621。

    This study employs five types of deep learning models: Recurrent Neural Network (RNN), Long Short-Term Memory (LSTM), Bidirectional Long Short-Term Memory (BiLSTM), Gated Recurrent Unit (GRU), and 1-Dimensional Convolutional Neural Network (1D CNN) to predict the stock price of Yuanta/P-shares Taiwan Top 50 ETF (ETF0050). The research collected ten years of stock data from January 2013 to January 2023 as the dataset and analyzed the correlation of various technical and index indicators to assess their relationship with the closing price. Using the Pearson correlation coefficient, the correlations were categorized into five levels: perfect correlation, high correlation, moderate correlation, low correlation, and negligible or no correlation. Subsequently, the data were divided into an 80% training set and a 20% test set, and a moving window method was applied for further analysis.
    Based on the five fundamental dimensions of the stock market—opening price, closing price, highest price, lowest price, and trading volume—three experimental setups were designed: Experiment 1 included all five dimensions; Experiment 2 excluded trading volume due to its lower correlation with closing price; and Experiment 3 replaced trading volume with the adjusted closing price. These setups were then paired with various combinations of technical indicators (ordered by Pearson correlation), resulting in 15 unique combinations for each deep learning model. The objective of this study is to compare the error rates in stock price prediction across these combinations to assess the predictive efficacy of different sets of technical indicators.
    The experimental results indicate that in experiments 2 and 3, most deep learning models exhibit relatively low prediction error rates in situations of complete and high correlation. Among them, the GRU model performs best in the highly correlated context of experiment 2, with MSE of 2.3314, MAE of 1.1531, and MAPE of 0.0092.
    Through confusion matrix evaluation, in the highly positively correlated scenarios of experiments 2 and 3 combined with Pearson correlation analysis, most deep learning models demonstrate higher accuracy. Specifically, the LSTM model performs well in the highly correlated context of experiment 2, with an accuracy of 0.629, precision of 0.603, recall of 0.639, and an F1-score of 0.621.

    摘要 I 致謝 IX 目次 X 表目錄 XII 圖目錄 XIII 第一章 緒論 1 1.1 研究背景與動機 1 1.2 研究目的 2 1.3 研究架構 3 第二章 文獻探討 4 2.1 皮爾森相關係數 4 2.2 技術指標 7 2.2.1 指數移動平均線 7 2.2.2 移動平均線 7 2.2.3 動量指標 8 2.2.4 相對強弱指標 8 2.2.5 隨機指標 9 2.2.6 乖離率 10 2.2.7 指數平滑異同移動平均線 11 2.2.8 布林通道 12 2.3 時間序列模型 13 2.3.1 循環神經網路 13 2.3.2 長短期記憶網路 14 2.3.3 門控循環單元 16 2.3.4 一維卷積神經網路 18 2.3.5 雙向長短期記憶網路 19 2.3.6 損失函數Huber Loss 20 2.3.7 Dropout 20 第三章 研究方法 21 3.1 研究架構 21 3.2 資料前處理 22 3.2.1 指數指標 22 3.2.2 計算技術指標 23 3.2.3 皮爾森相關係數 25 3.2.4 分割資料 26 3.2.5 資料正規化 26 3.3 實驗設計 27 3.4 實驗結果比較 29 3.4.1 評估指標 29 3.4.2 混淆矩陣 30 3.4.3 交易策略 31 第四章 實驗結果 32 4.1 環境設定 32 4.2 資料集描述 33 4.3 資料前處理 34 4.4 參數設定 36 4.5 實驗結果 37 4.5.1 RNN實驗結果 37 4.5.2 LSTM實驗結果 40 4.5.3 GRU實驗結果 43 4.5.4 BiLSTM實驗結果 46 4.5.5 1D CNN實驗結果 49 4.6 討論 52 第五章 結論與未來展望 56 5.1 結論 56 5.2 研究限制 56 5.3 未來展望 57 參考文獻 59

    1. Gu, J., et al., Recent advances in convolutional neural networks. Pattern Recognition, 2018. 77: p. 354-377.
    2. Adadi, A. and M. Berrada, Peeking Inside the Black-Box: A Survey on Explainable Artificial Intelligence (XAI). IEEE Access, 2018. 6: p. 52138-52160.
    3. Cho, K., et al., Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078, 2014.
    4. Hochreiter, S. and J. Schmidhuber, Long Short-Term Memory. Neural Computation, 1997. 9(8): p. 1735-1780.
    5. Samarakoon, L.P., Stock market interdependence, contagion, and the U.S. financial crisis: The case of emerging and frontier markets. Journal of International Financial Markets, Institutions and Money, 2011. 21(5): p. 724-742.
    6. Hsieh, W.-j., Implications of  the U.S.–China Trade War  for  Taiwan*. Asian Economic Papers, 2020. 19(1): p. 61-81.
    7. Lee, K.-J. and S.-L. Lu, The Impact of COVID-19 on the Stock Price of Socially Responsible Enterprises: An Empirical Study in Taiwan Stock Market. International Journal of Environmental Research and Public Health, 2021. 18(4): p. 1398.
    8. Clark, P.K., A Subordinated Stochastic Process Model with Finite Variance for Speculative Prices. Econometrica, 1973. 41(1): p. 135-155.
    9. Hamilton, J.D., Time series analysis. 2020: Princeton university press.
    10. Jordan, M.I. and T.M. Mitchell, Machine learning: Trends, perspectives, and prospects. Science, 2015. 349(6245): p. 255-260.
    11. Vargas, M.R., et al. Deep Leaming for Stock Market Prediction Using Technical Indicators and Financial News Articles. in 2018 International Joint Conference on Neural Networks (IJCNN). 2018.
    12. Schober, P., C. Boer, and L.A. Schwarte, Correlation coefficients: appropriate use and interpretation. Anesthesia & analgesia, 2018. 126(5): p. 1763-1768.
    13. Li, G., et al., Pearson Correlation Coefficient-Based Performance Enhancement of Broad Learning System for Stock Price Prediction. IEEE Transactions on Circuits and Systems II: Express Briefs, 2022. 69(5): p. 2413-2417.
    14. Sherstinsky, A., Fundamentals of recurrent neural network (RNN) and long short-term memory (LSTM) network. Physica D: Nonlinear Phenomena, 2020. 404: p. 132306.
    15. Schuster, M. and K.K. Paliwal, Bidirectional recurrent neural networks. IEEE Transactions on Signal Processing, 1997. 45(11): p. 2673-2681.
    16. Kiranyaz, S., et al., 1D convolutional neural networks and applications: A survey. Mechanical Systems and Signal Processing, 2021. 151: p. 107398.
    17. Chicco, D., M.J. Warrens, and G. Jurman, The coefficient of determination R-squared is more informative than SMAPE, MAE, MAPE, MSE and RMSE in regression analysis evaluation. PeerJ Computer Science, 2021. 7: p. e623.
    18. Pearson, K., VII. Mathematical contributions to the theory of evolution.—III. Regression, heredity, and panmixia. Philosophical Transactions of the Royal Society of London. Series A, containing papers of a mathematical or physical character, 1896(187): p. 253-318.
    19. Lee Rodgers, J. and W.A. Nicewander, Thirteen ways to look at the correlation coefficient. The American Statistician, 1988. 42(1): p. 59-66.
    20. Mukaka, M.M., A guide to appropriate use of correlation coefficient in medical research. Malawi medical journal, 2012. 24(3): p. 69-71.
    21. Godfrey, M.D., C.W. Granger, and O. Morgenstern, THE RANDOM‐WALK HYPOTHESIS OF STOCK MARKET BEHAVIOR a. Kyklos, 1964. 17(1): p. 1-30.
    22. Lo, A.W. and A.C. MacKinlay, Stock market prices do not follow random walks: Evidence from a simple specification test. The review of financial studies, 1988. 1(1): p. 41-66.
    23. Hansun, S. A new approach of moving average method in time series analysis. in 2013 Conference on New Media Studies (CoNMedia). 2013.
    24. Wei, L.-Y., C.-H. Cheng, and H.-H. Wu, A hybrid ANFIS based on n-period moving average model to forecast TAIEX stock. Applied Soft Computing, 2014. 19: p. 86-92.
    25. Louis, K.C.C., N. Jegadeesh, and J. Lakonishok, Momentum Strategies. The Journal of Finance, 1996. 51(5): p. 1681-1713.
    26. Wilder, J.W., New concepts in technical trading systems. (No Title), 1978.
    27. Adrian, r.-M., The relative strength index revisited. African Journal of Business Management, 2011. 5(14): p. 5855-5862.
    28. Markus, L. and A. Weerasinghe, Stochastic oscillators. Journal of Differential Equations, 1988. 71(2): p. 288-314.
    29. Kamble, R.A. Short and long term stock trend prediction using decision tree. in 2017 International Conference on Intelligent Computing and Control Systems (ICICCS). 2017. IEEE.
    30. Beaver, W.H. and S.G. Ryan, Biases and lags in book value and their effects on the ability of the book-to-market ratio to predict book return on equity. Journal of accounting research, 2000. 38(1): p. 127-148.
    31. Appel, G., The moving average convergence-divergence trading method: advanced version. 1985: Scientific Investment Systems.
    32. Wang, J. and J. Kim, Predicting stock price trend using MACD optimized by historical volatility. Mathematical Problems in Engineering, 2018. 2018: p. 1-12.
    33. Bollinger, J., Using bollinger bands. Stocks & Commodities, 1992. 10(2): p. 47-51.
    34. Lento, C., N. Gradojevic, and C.S. Wright, Investment information content in Bollinger Bands? Applied Financial Economics Letters, 2007. 3(4): p. 263-267.
    35. Elman, J.L., Finding structure in time. Cognitive Science, 1990. 14(2): p. 179-211.
    36. Olah, C. Understanding LSTM Networks. 2015 [cited 2023 DEC. 12]; Available from: https://colah.github.io/posts/2015-08-Understanding-LSTMs/.
    37. Hochreiter, S., The vanishing gradient problem during learning recurrent neural nets and problem solutions. International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems, 1998. 6(02): p. 107-116.
    38. Wang, H., et al., Automated Student Classroom Behaviors’ Perception and Identification Using Motion Sensors. Bioengineering, 2023. 10(2): p. 127.
    39. Zhou, P., et al. Attention-based bidirectional long short-term memory networks for relation classification. in Proceedings of the 54th annual meeting of the association for computational linguistics (volume 2: Short papers). 2016.
    40. Huber, P.J., Robust statistics. Vol. 523. 2004: John Wiley & Sons.
    41. Srivastava, N., et al., Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 2014. 15(1): p. 1929-1958.
    42. Lei, L., Wavelet neural network prediction method of stock price trend based on rough set attribute reduction. Applied Soft Computing, 2018. 62: p. 923-932.
    43. Moghaddam, A.H., M.H. Moghaddam, and M. Esfandyari, Stock market index prediction using artificial neural network. Journal of Economics, Finance and Administrative Science, 2016. 21(41): p. 89-93.
    44. Jiang, W., Applications of deep learning in stock market prediction: Recent progress. Expert Systems with Applications, 2021. 184: p. 115537.
    45. Selvin, S., et al. Stock price prediction using LSTM, RNN and CNN-sliding window model. in 2017 international conference on advances in computing, communications and informatics (icacci). 2017. IEEE.
    46. Sen, J., A. Dutta, and S. Mehtab. Profitability Analysis in Stock Investment Using an LSTM-Based Deep Learning Model. in 2021 2nd International Conference for Emerging Technology (INCET). 2021.
    47. Kuber, V., D. Yadav, and A.K. Yadav, Univariate and Multivariate LSTM Model for Short-Term Stock Market Prediction. arXiv preprint arXiv:2205.06673, 2022.

    下載圖示 校內:立即公開
    校外:立即公開
    QR CODE