學術產出-Theses

Article View/Open

Publication Export

Google ScholarTM

政大圖書館

Citation Infomation

題名 基於 BERT 與 GRU 深度學習模型 - 建構新聞情緒下 Black-Litterman 投資組合
Based on BERT and GRU Deep Learning Model - Constructing a Black-Litterman Portfolio under News Sentiment
作者 夏秉宏
Hsia, Ping-Hung
貢獻者 翁久幸<br>林士貴
Weng, Chiu-Hsing<br>Lin, Shih-Kuei
夏秉宏
Hsia, Ping-Hung
關鍵詞 投資組合理論
情感分析
股票投資預測
自然語言處理
深度學習
Portfolio theory
Sentiment analysis
Stock price prediction
Natural language processing
Deep learning
日期 2020
上傳時間 3-Aug-2020 17:32:00 (UTC+8)
摘要 Black-Litterman模型(Black et al., 1990)試圖通過投資者觀點分配的建構來解決 Markowitz Portfolio模型(Markowitz, 1952)所遇到的問題。然而,建立投資者觀點分配需要對投資資產的未來報酬進行預測,由於我們針對股票進行投資,故可被視為一個股價預測的問題。 在本研究中,我們使用深度學習的方法來預測我們的資產價格,除了以資產的股票價格和交易量作為特徵之外,同時也認為新聞情緒是影響股票走勢的重要因素之一。

首先,我們使用 BERT(Devlin et al., 2018)衡量新聞情緒。將之定義為一個二元分類問題,並透過 BERT 模型進行情感分析訓練來判斷新聞資料帶來消息的好與壞。接著,利用三種不同的深度學習模型,分別為 vanilla RNN(Rumelhart et al., 1985),LSTM(Hochreiter et al., 1997)和 GRU(Cho et al., 2014)對股票價格進行預測,觀察不同模型的預測能力是否會影響 Black-Litterman 模型之表現結果。為了擁有夠多之新聞資料數量訓練BERT 模型,我們以美國標準普爾500指數(S&P 500)
中之七檔成分股作為投資標的,目標在於建構績效良好之投資組合。因此,我們將以四種財務指標衡量基於三種不同深度學習模型建構出之Black-Litterman模型之績效,並以其他三種投資組合作為我們的基準模型。

從本研究實證分析,我們可得到以下之結果:

1. 在三種深度學習模型中,我們以均方誤差 (Mean Square Error) 比較模型預測結果的好壞。GRU 模型 在七項投資股票資產中的表現皆優於其餘兩個模型,更能夠有效捕捉到股票未來之走勢及價格。而 LSTM 模型的表現也比 RNN 模型來得更佳。

2. 在投資組合的模型比較中,以 BERT 判斷新聞情緒並以 GRU 模型預測股價所建構出之 Black-Litterman 模型擁有最高的 46.6% 年化報酬率。同時,其擁有最高的 13.0% Sharpe Ratio 與 17.9% 之 Sortino Ratio,代表其在一定風險程度下,仍較其他建構出之投資組合來得更加優異。
The Black-Litterman Model (Black et al., 1990) attempts to solve the problems encountered by the Markowitz Portfolio Model (Markowitz, 1952) through the construction of investor view distribution. However, the construction of an investor`s point of view distribution requires future returns on investment assets. In this study, we use deep learning methods to predict our asset prices. In addition to the asset’s stock price and trading volume, we also assume that sentiment from news is one of the important factors that affect the stock trend.

First, we use BERT (Devlin et al., 2018) to measure news sentiment. It is defined as a binary classification problem, and sentiment analysis training is conducted through the BERT model to judge whether the stock news bring good news or bad news. Then, use three different deep learning models, namely vanilla RNN (Rumelhart et al., 1985), LSTM (Hochreiter et al., 1997) and GRU (Cho et al., 2014) to predict the stock price and observe whether the predictive ability of the different models will affect the performance of the Black-Litterman model. In order to have enough news materials to train the BERT model, we use the seven stocks in the S&P500 as investment assets.
The goal is to build a portfolio with good performance.
Therefore, we will use four financial metrics to measure the performance of the Black-Litterman model constructed based on these three different deep learning models. At the same time, there are three benchmark models with the other portfolio methods.

From the empirical analysis of our study, we can get the following results:

1. Among the three deep learning models, we use mean square error to compare the model prediction results. The GRU model outperforms the other two models in the performance of seven investment stock assets, and can more effectively capture the future trend and price of the stock. The LSTM model performs better than the RNN model.

2. In the comparison of the portfolio models, the Black-Litterman model constructed by using BERT to measure news sentiment and using the GRU model to predict stock prices has the highest annualized return rate of 46.6%. At the same time, it has the highest 13.0% Sharpe Ratio and 17.9% Sortino Ratio, which means that it is still better than other constructed portfolios under a certain degree of risk.
參考文獻 Akita, R., Yoshihara, A., Matsubara, T., Uehara, K. (2016). Deep learning for stock prediction using numerical and textual information. International Conference on Computer and Information Science IEEE, (June), 1-6.

Ariyo, A. A., Adewumi, A. O., Ayo, C. K. (2014). Stock price prediction using the ARIMA model. International Conference on Computer Modelling and Simulation IEEE, (March), 106-112.

Avramov, D., & Zhou, G. (2010). Bayesian portfolio analysis. Annual Review Financial Economics, 2(1), 25-47.

Bahdanau, D., Cho, K., & Bengio, Y. (2014). Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473.

Bengio, Y., Ducharme, R., Vincent, P., Jauvin, C. (2003). A neural probabilistic language model. Journal of machine learning research, 3(Feb), 1137-1155.

Best, M. J., & Grauer, R. R. (1991). On the sensitivity of mean-variance-efficient portfolios to changes in asset means: some analytical and computational results. The review of financial studies, 4(2), 315-342.

Birbeck, E., & Cliff, D. (2018). Using Stock Prices as Ground Truth in Sentiment Analysis to Generate Profitable Trading Signals. IEEE Symposium Series on Computational Intelligence, (November), 1868-1875.

Black, F., & Litterman, R. (1990). Asset allocation: combining investor views with market equilibrium. Goldman Sachs Fixed Income Research, 115.

Black, F., \\& Litterman, R. (1992). Global portfolio optimization. Financial analysts journal, 48(5), 28-43.

Blei, D. M., Ng, A. Y., & Jordan, M. I. (2003). Latent dirichlet allocation. Journal of machine Learning research, 3(January), 993-1022.

Cambria, E., Speer, R., Havasi, C., & Hussain, A. (2010). Senticnet: A publicly available semantic resource for opinion mining. AAAI Fall Symposium Series., (November).

Chang, C. C., & Lin, C. J. (2011). LIBSVM: A library for support vector machines. ACM transactions on intelligent systems and technology (TIST), 2(3), 1-27.

Cho, K., Van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., & Bengio, Y. (2014). Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078.

Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.

Ding, X., Zhang, Y., Liu, T., & Duan, J. (2014). Using structured events to predict stock price movement: An empirical investigation. Empirical Methods in Natural Language Processing, (October), 1415-1425.

Fama, E. F. (1995). Random walks in stock market prices. Financial analysts journal, 51(1), 75-80.

He, G., & Litterman, R. (2002). The intuition behind Black-Litterman model portfolios. Social Science Research Network 334304.

Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8), 1735-1780.

Idzorek, T. (2007). A step-by-step guide to the Black-Litterman model: Incorporating user-specified confidence levels. Forecasting expected returns in the financial markets, 17-38.

Le, Q., & Mikolov, T. (2014). Distributed representations of sentences and documents. International conference on machine learning, (January), 1188-1196.

Lee, W. (2000). Advanced Theory and Methodology of Tactical Asset Allocation. New York: John Wiley & Sons.

Litterman, B. (2004). Modern investment management: an equilibrium approach (Vol. 246). John Wiley & Sons.

Malkiel, B. G., & Fama, E. F. (1970). Efficient capital markets: A review of theory and empirical work. The journal of Finance, 25(2), 383-417.

Markowitz, H.M. (1952). “Portfolio Selection.” The Journal of Finance, (March), 77-91.

Michaud, R. O. (1989). The Markowitz optimization enigma: Is ‘optimized’optimal?. Financial Analysts Journal, 45(1), 31-42.

Mikolov, T., Karafiát, M., Burget, L., Černocký, J., & Khudanpur, S. (2010). Recurrent neural network based language model.Eleventh annual conference of the international speech communication association.

Mikolov, T., Sutskever, I., Chen, K., Corrado, G. S., & Dean, J. (2013). Distributed representations of words and phrases and their compositionality. Advances in neural information processing systems, 3111-3119.

Satchell, S., & Scowcroft, A. (2000). A demystification of the Black–Litterman model: Managing quantitative and traditional portfolio construction. Journal of Asset Management, 1}(2), 138-150.

Peters, M. E., Neumann, M., Iyyer, M., Gardner, M., Clark, C., Lee, K., & Zettlemoyer, L. (2018). Deep contextualized word representations. arXiv preprint arXiv:1802.05365.

Rumelhart, D. E., Hinton, G. E., & Williams, R. J. (1985). Learning internal representations by error propagation (No. ICS-8506). California Univ San Diego La Jolla Inst for Cognitive Science.

Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., ... & Polosukhin, I. (2017). Attention is all you need. Advances in neural information processing systems, 5998-6008.

Wang, J. H., Liu, T. W., Luo, X., & Wang, L. (2018). An lstm approach to short text sentiment classification with word embeddings. Proceedings of the 30th conference on computational linguistics and speech processing, (October), 214-223.

Wu, Y., Schuster, M., Chen, Z., Le, Q. V., Norouzi, M., Macherey, W., & Klingner, J. (2016). Google`s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144.

Xing, F. Z., Cambria, E., & Welsch, R. E. (2018). Intelligent asset allocation via market sentiment views. IEEE ComputatioNal iNtelligeNCe magaziNe, 13(4), 25-34.
描述 碩士
國立政治大學
統計學系
107354017
資料來源 http://thesis.lib.nccu.edu.tw/record/#G0107354017
資料類型 thesis
dc.contributor.advisor 翁久幸<br>林士貴zh_TW
dc.contributor.advisor Weng, Chiu-Hsing<br>Lin, Shih-Kueien_US
dc.contributor.author (Authors) 夏秉宏zh_TW
dc.contributor.author (Authors) Hsia, Ping-Hungen_US
dc.creator (作者) 夏秉宏zh_TW
dc.creator (作者) Hsia, Ping-Hungen_US
dc.date (日期) 2020en_US
dc.date.accessioned 3-Aug-2020 17:32:00 (UTC+8)-
dc.date.available 3-Aug-2020 17:32:00 (UTC+8)-
dc.date.issued (上傳時間) 3-Aug-2020 17:32:00 (UTC+8)-
dc.identifier (Other Identifiers) G0107354017en_US
dc.identifier.uri (URI) http://nccur.lib.nccu.edu.tw/handle/140.119/130959-
dc.description (描述) 碩士zh_TW
dc.description (描述) 國立政治大學zh_TW
dc.description (描述) 統計學系zh_TW
dc.description (描述) 107354017zh_TW
dc.description.abstract (摘要) Black-Litterman模型(Black et al., 1990)試圖通過投資者觀點分配的建構來解決 Markowitz Portfolio模型(Markowitz, 1952)所遇到的問題。然而,建立投資者觀點分配需要對投資資產的未來報酬進行預測,由於我們針對股票進行投資,故可被視為一個股價預測的問題。 在本研究中,我們使用深度學習的方法來預測我們的資產價格,除了以資產的股票價格和交易量作為特徵之外,同時也認為新聞情緒是影響股票走勢的重要因素之一。

首先,我們使用 BERT(Devlin et al., 2018)衡量新聞情緒。將之定義為一個二元分類問題,並透過 BERT 模型進行情感分析訓練來判斷新聞資料帶來消息的好與壞。接著,利用三種不同的深度學習模型,分別為 vanilla RNN(Rumelhart et al., 1985),LSTM(Hochreiter et al., 1997)和 GRU(Cho et al., 2014)對股票價格進行預測,觀察不同模型的預測能力是否會影響 Black-Litterman 模型之表現結果。為了擁有夠多之新聞資料數量訓練BERT 模型,我們以美國標準普爾500指數(S&P 500)
中之七檔成分股作為投資標的,目標在於建構績效良好之投資組合。因此,我們將以四種財務指標衡量基於三種不同深度學習模型建構出之Black-Litterman模型之績效,並以其他三種投資組合作為我們的基準模型。

從本研究實證分析,我們可得到以下之結果:

1. 在三種深度學習模型中,我們以均方誤差 (Mean Square Error) 比較模型預測結果的好壞。GRU 模型 在七項投資股票資產中的表現皆優於其餘兩個模型,更能夠有效捕捉到股票未來之走勢及價格。而 LSTM 模型的表現也比 RNN 模型來得更佳。

2. 在投資組合的模型比較中,以 BERT 判斷新聞情緒並以 GRU 模型預測股價所建構出之 Black-Litterman 模型擁有最高的 46.6% 年化報酬率。同時,其擁有最高的 13.0% Sharpe Ratio 與 17.9% 之 Sortino Ratio,代表其在一定風險程度下,仍較其他建構出之投資組合來得更加優異。
zh_TW
dc.description.abstract (摘要) The Black-Litterman Model (Black et al., 1990) attempts to solve the problems encountered by the Markowitz Portfolio Model (Markowitz, 1952) through the construction of investor view distribution. However, the construction of an investor`s point of view distribution requires future returns on investment assets. In this study, we use deep learning methods to predict our asset prices. In addition to the asset’s stock price and trading volume, we also assume that sentiment from news is one of the important factors that affect the stock trend.

First, we use BERT (Devlin et al., 2018) to measure news sentiment. It is defined as a binary classification problem, and sentiment analysis training is conducted through the BERT model to judge whether the stock news bring good news or bad news. Then, use three different deep learning models, namely vanilla RNN (Rumelhart et al., 1985), LSTM (Hochreiter et al., 1997) and GRU (Cho et al., 2014) to predict the stock price and observe whether the predictive ability of the different models will affect the performance of the Black-Litterman model. In order to have enough news materials to train the BERT model, we use the seven stocks in the S&P500 as investment assets.
The goal is to build a portfolio with good performance.
Therefore, we will use four financial metrics to measure the performance of the Black-Litterman model constructed based on these three different deep learning models. At the same time, there are three benchmark models with the other portfolio methods.

From the empirical analysis of our study, we can get the following results:

1. Among the three deep learning models, we use mean square error to compare the model prediction results. The GRU model outperforms the other two models in the performance of seven investment stock assets, and can more effectively capture the future trend and price of the stock. The LSTM model performs better than the RNN model.

2. In the comparison of the portfolio models, the Black-Litterman model constructed by using BERT to measure news sentiment and using the GRU model to predict stock prices has the highest annualized return rate of 46.6%. At the same time, it has the highest 13.0% Sharpe Ratio and 17.9% Sortino Ratio, which means that it is still better than other constructed portfolios under a certain degree of risk.
en_US
dc.description.tableofcontents 1 Introduction 8
2 Related Work 10
2.1 Modern Portfolio Methods 10
2.1.1 Markowitz Portfolio Model 10
2.1.2 Black-Litterman Model 11
2.2 Sentiment Analysis 12
2.3 Stock Price Prediction 14
3 Methodology 16
3.1 Modern Portfolio Methods 16
3.1.1 Markowitz Portfolio Model 16
3.1.2 Black-Litterman Model 18
3.2 NLP Methods 23
3.2.1 Word Embeddings 23
3.2.2 Contextualized Word Embeddings 23
3.2.3 Transformer 25
3.2.4 Google BERT 28
3.3 Deep Learning Methods 32
3.3.1 Recurrent Neural Network 32
3.3.2 Long Short-term Memory 33
3.3.3 Gated Recurrent Unit 34
4 Experiment Results 37
4.1 Data Description 38
4.2 Data Preprocessing 38
4.2.1 Stock News 38
4.2.2 Stock Price and Trading Volume 39
4.3 News Sentiment 40
4.4 Stock Price Prediction 41
4.5 Black-Litterman Model Performance 45
4.5.1 Benchmark Models 46
4.5.2 Black-Litterman Based Portfolios 46
4.5.3 Evaluation 46
5 Conclusion 49
6 Future Result 50
References 51
zh_TW
dc.format.extent 1403632 bytes-
dc.format.mimetype application/pdf-
dc.source.uri (資料來源) http://thesis.lib.nccu.edu.tw/record/#G0107354017en_US
dc.subject (關鍵詞) 投資組合理論zh_TW
dc.subject (關鍵詞) 情感分析zh_TW
dc.subject (關鍵詞) 股票投資預測zh_TW
dc.subject (關鍵詞) 自然語言處理zh_TW
dc.subject (關鍵詞) 深度學習zh_TW
dc.subject (關鍵詞) Portfolio theoryen_US
dc.subject (關鍵詞) Sentiment analysisen_US
dc.subject (關鍵詞) Stock price predictionen_US
dc.subject (關鍵詞) Natural language processingen_US
dc.subject (關鍵詞) Deep learningen_US
dc.title (題名) 基於 BERT 與 GRU 深度學習模型 - 建構新聞情緒下 Black-Litterman 投資組合zh_TW
dc.title (題名) Based on BERT and GRU Deep Learning Model - Constructing a Black-Litterman Portfolio under News Sentimenten_US
dc.type (資料類型) thesisen_US
dc.relation.reference (參考文獻) Akita, R., Yoshihara, A., Matsubara, T., Uehara, K. (2016). Deep learning for stock prediction using numerical and textual information. International Conference on Computer and Information Science IEEE, (June), 1-6.

Ariyo, A. A., Adewumi, A. O., Ayo, C. K. (2014). Stock price prediction using the ARIMA model. International Conference on Computer Modelling and Simulation IEEE, (March), 106-112.

Avramov, D., & Zhou, G. (2010). Bayesian portfolio analysis. Annual Review Financial Economics, 2(1), 25-47.

Bahdanau, D., Cho, K., & Bengio, Y. (2014). Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473.

Bengio, Y., Ducharme, R., Vincent, P., Jauvin, C. (2003). A neural probabilistic language model. Journal of machine learning research, 3(Feb), 1137-1155.

Best, M. J., & Grauer, R. R. (1991). On the sensitivity of mean-variance-efficient portfolios to changes in asset means: some analytical and computational results. The review of financial studies, 4(2), 315-342.

Birbeck, E., & Cliff, D. (2018). Using Stock Prices as Ground Truth in Sentiment Analysis to Generate Profitable Trading Signals. IEEE Symposium Series on Computational Intelligence, (November), 1868-1875.

Black, F., & Litterman, R. (1990). Asset allocation: combining investor views with market equilibrium. Goldman Sachs Fixed Income Research, 115.

Black, F., \\& Litterman, R. (1992). Global portfolio optimization. Financial analysts journal, 48(5), 28-43.

Blei, D. M., Ng, A. Y., & Jordan, M. I. (2003). Latent dirichlet allocation. Journal of machine Learning research, 3(January), 993-1022.

Cambria, E., Speer, R., Havasi, C., & Hussain, A. (2010). Senticnet: A publicly available semantic resource for opinion mining. AAAI Fall Symposium Series., (November).

Chang, C. C., & Lin, C. J. (2011). LIBSVM: A library for support vector machines. ACM transactions on intelligent systems and technology (TIST), 2(3), 1-27.

Cho, K., Van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., & Bengio, Y. (2014). Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078.

Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. (2018). Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805.

Ding, X., Zhang, Y., Liu, T., & Duan, J. (2014). Using structured events to predict stock price movement: An empirical investigation. Empirical Methods in Natural Language Processing, (October), 1415-1425.

Fama, E. F. (1995). Random walks in stock market prices. Financial analysts journal, 51(1), 75-80.

He, G., & Litterman, R. (2002). The intuition behind Black-Litterman model portfolios. Social Science Research Network 334304.

Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8), 1735-1780.

Idzorek, T. (2007). A step-by-step guide to the Black-Litterman model: Incorporating user-specified confidence levels. Forecasting expected returns in the financial markets, 17-38.

Le, Q., & Mikolov, T. (2014). Distributed representations of sentences and documents. International conference on machine learning, (January), 1188-1196.

Lee, W. (2000). Advanced Theory and Methodology of Tactical Asset Allocation. New York: John Wiley & Sons.

Litterman, B. (2004). Modern investment management: an equilibrium approach (Vol. 246). John Wiley & Sons.

Malkiel, B. G., & Fama, E. F. (1970). Efficient capital markets: A review of theory and empirical work. The journal of Finance, 25(2), 383-417.

Markowitz, H.M. (1952). “Portfolio Selection.” The Journal of Finance, (March), 77-91.

Michaud, R. O. (1989). The Markowitz optimization enigma: Is ‘optimized’optimal?. Financial Analysts Journal, 45(1), 31-42.

Mikolov, T., Karafiát, M., Burget, L., Černocký, J., & Khudanpur, S. (2010). Recurrent neural network based language model.Eleventh annual conference of the international speech communication association.

Mikolov, T., Sutskever, I., Chen, K., Corrado, G. S., & Dean, J. (2013). Distributed representations of words and phrases and their compositionality. Advances in neural information processing systems, 3111-3119.

Satchell, S., & Scowcroft, A. (2000). A demystification of the Black–Litterman model: Managing quantitative and traditional portfolio construction. Journal of Asset Management, 1}(2), 138-150.

Peters, M. E., Neumann, M., Iyyer, M., Gardner, M., Clark, C., Lee, K., & Zettlemoyer, L. (2018). Deep contextualized word representations. arXiv preprint arXiv:1802.05365.

Rumelhart, D. E., Hinton, G. E., & Williams, R. J. (1985). Learning internal representations by error propagation (No. ICS-8506). California Univ San Diego La Jolla Inst for Cognitive Science.

Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., ... & Polosukhin, I. (2017). Attention is all you need. Advances in neural information processing systems, 5998-6008.

Wang, J. H., Liu, T. W., Luo, X., & Wang, L. (2018). An lstm approach to short text sentiment classification with word embeddings. Proceedings of the 30th conference on computational linguistics and speech processing, (October), 214-223.

Wu, Y., Schuster, M., Chen, Z., Le, Q. V., Norouzi, M., Macherey, W., & Klingner, J. (2016). Google`s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144.

Xing, F. Z., Cambria, E., & Welsch, R. E. (2018). Intelligent asset allocation via market sentiment views. IEEE ComputatioNal iNtelligeNCe magaziNe, 13(4), 25-34.
zh_TW
dc.identifier.doi (DOI) 10.6814/NCCU202000816en_US