股票在近期成為全民的熱門話題之一,股票最低只要1,000元就能夠定期定額投資,還能透過手機App在盤中自選購買零股,資金的門檻和操作方式都比以往更平易近人,但是股票價格的波動是非常動態的,因此需要準確的數據建模來預測股票價格。使用深度學習的預測模型被認為能夠準確預測股票價格,尤其是長短期記憶(LSTM)和門控循環單元(GRU)。而預言家(Prophet)是Facebook開發的一個時間序列模型,「Prophet」適用於有趨勢及季節性週期變化結構的資料。 在本論文中,通過使用長短期記憶(LSTM)、門控循環單元(GRU)和預言家(Prophet)來預測台灣不同產業的股票,並使用均方根誤差(RMSE)和平均絕對百分比誤差(MAPE)的損失函數來評估構建模型的準確性。 最終本研究得到在少量變數的情況下,Prophet模型表現高效且穩健;而在多變數的情況下,GRU模型相對於LSTM和Prophet模型更具優勢。然而,在股票市場中,還有許多其他變數和因素會影響股票的走勢,因此建議後續研究可以納入更多不同的變數來進行預測,以提高預測準確性。
Stocks have recently become one of the hot topics among the people. Stocks can be invested in a fixed amount with as little as 1,000 new Taiwan dollar. You can also buy fractional shares in the market through the mobile app. The threshold of funds and operation methods are easier to approach people than before, but the volatility of the stock price wave is abnormally volatile, so accurate data is needed to build a model to predict the stock price. Predictive models using deep learning, especially long short-term memory (LSTM) and gated recurrent unit (GRU), are believed to be able to accurately predict stock prices. The prophet is a time series model developed by Facebook. "Prophet" is suitable for trend and seasonal change structure data. In this paper, by using long short-term memory (LSTM), gated recurrent unit (GRU) and Prophet to predict stocks in different industries in Taiwan, and using root mean square error (RMSE) and average absolute percentage error (MAPE) loss function to evaluate the accuracy of the structural model. Finally, it is studied that in the case of a small number of changes, the prophet model is efficient and robust; and in the case of multiple changes, the GRU model has advantages over the LSTM and Prophet models. However, in the stock market, there are many other changes and factors that will affect the trend of the stock, so it is suggested that follow-up research can include more different changes in the forecast to improve the accuracy of the forecast.