Please use this identifier to cite or link to this item:
http://hdl.handle.net/11607/4518
Title: | Derin öğrenme ile hisse senedi piyasası tahmini |
Other Titles: | Predicting stock market by using deep learning |
Authors: | Hayat, Elvan Aydın, Olgun Altunbaş, Cansu Aydın Adnan Menderes Üniversitesi Sosyal Bilimler Enstitüsü Ekonometri Ana Bilim Dalı |
Keywords: | Boruta Algoritması, Hiper parametre Optimizasyonu, İleri Beslemeli Derin Sinir Ağı, Izgara Arama Yöntemi, XBANK Boruta Algorithm, Deep Learning, Deep Neural Networks, Grid Search, Hyperparameter Optimization, XBANK |
Issue Date: | 4-Nov-2021 |
Publisher: | Aydın Adnan Menderes Üniversitesi Sosyal Bilimler Enstitüsü |
Citation: | Altunbaş, C. (2021) Derin öğrenme ile hisse senedi piyasası tahmini (yayınlanmamış yüksek lisans tezi) Aydın Adnan Menderes Üniversitesi Sosyal Bilimler Enstitüsü, Aydın |
Abstract: | Borsa, sermaye piyasası araçlarının alınıp satıldığı organize bir hisse senedi
piyasasıdır. Yatırımcılar tarafından gerçekleştirilen bu alım satım işlemi sonrasında kar ya da
zarar elde edilmektedir. Yatırımcıların piyasalar hakkında doğru bir öngörü sahibi olması ile
zarar en az düzeyde gerçekleşebilir. Finansal piyasalar için öngörüde bulunmak akademik
çalışmalarda ve iş dünyasında oldukça önemli bir yer tutmaktadır.
Bu tez çalışmasında XBANK olarak ifade edilen banka endeksinin bir sonraki günkü
kapanış değerinin derin öğrenme metotları kullanılarak tahmin edilmesi amaçlanmıştır. Bu
amaçla, 04.11.2015- 04.11.2019 tarihleri arasında banka endeksine ait günlük kapanış, açılış,
en yüksek, en düşük değerler, çeşitli teknik göstergeler, çeşitli makroekonomik değişkenler
ve metinsel veriler kullanılmıştır. Seçilen teknik göstergeler; RSI, MACD, Momentum,
William, Basit Hareketli Ortalama, Stokastic K ve Stokastic D’dir. Seçilen makroekonomik
göstergeler ise; euro kuru, dolar kuru, brent petrol ve gram altın fiyatlarıdır. Tüm bu
değişkenlerin 10 gecikmeye kadarki değerleri de veri setine dahil edilmiştir. Ayrıca resmî
tatillerde işlem görmeyen endeksin kapanış, açılış, en yüksek ve en düşük değerleri için bir
önceki güne ait değerler kullanılmıştır. Veri setinde bu durumu ifade edebilmek için dummy
değişken oluşturulmuş ve resmî tatil günlerine 0, işlem günlerine 1 değeri verilmiştir.
Metinsel veriler, seçilen iki internet sitesinden web kazıma tekniği ile elde edilen haber
başlıklarıdır. Seçilen internet siteleri ise www.investing.com ve www.dunya.com ‘dur.
Analizde kullanılmak üzere üç farklı veri seti hazırlanmıştır. İlki finansal ve metinsel
veri setlerinin birleşiminden oluşan, ikincisi finansal verilerle oluşturulan, üçüncüsü ise
metinsel verilerle oluşturulan veri setidir. Her bir veri seti için veriler, %70’i eğitim seti,
%30’u test seti olmak üzere ikiye ayrılarak analize devam edilmiştir. Veri setlerindeki
değişkenlerden modele pozitif katkı sağlamayanlar eğitim setinden çıkarılmıştır. Bu işlem
Boruta algoritması uygulanarak yapılmıştır. Ardından kullanılacak derin öğrenme modeli
vi
belirlenmiştir. Analizde kullanılan derin öğrenme modeli ileri beslemeli derin sinir ağı
modelidir.
Modelde kullanılan hiper parametreleri bulmak amacıyla optimizasyon işlemi
gerçekleştirilmiştir. Hiper parametre optimizasyonu olarak adlandırılan bu işlem için ızgara
arama yöntemi kullanılmıştır. Uygun değişkenlerin ve hiper parametrelerin belirlenmesinin
ardından veri seti eğitilmiştir. Eğitim seti kullanılarak eğitilen model ile test setindeki veriler
için tahmin sonuçları elde edilmiştir. Üç farklı veri setinden elde edilen tahmin sonuçları ile
gerçek sonuçlar karşılaştırılmıştır. Bu sonuçlarda genel olarak endeksin yönü doğru tahmin
edilebilir iken, kapanış değerinin tahmininde sapmalar gözlemlenmiştir. Özellikle test
setindeki Haziran – Aralık 2019 arasındaki gerçek değerleri tahmin etmede modellerin
başarılı olmadığı ve tahmin edilen değer ile gerçek değer arasındaki farkı ifade eden kalıntı
değerinde negatif anlamda ayrışma olduğu gözlemlenmiştir. Bu dönemlerde yaşanan
dalgalanmanın nedenini tespit etmek amacıyla, metinsel veri setindeki haber başlıkları
incelenmiştir ve bu dönemdeki siyasi haber akışının banka endeksinin kapanış değerinde
volatilite yarattığı, bu nedenle de model tarafından ilgili dönemde doğru tahmin yapılamadığı
sonucuna varılmıştır.
Son olarak derin öğrenmede topluluk öğrenmesi metodolojisi kullanılarak veri
setlerinden ayrı ayrı elde edilen tahmin sonuçlarının farklı kombinasyonlarda ortalama
değerleri bulunarak gerçek değerlerle karşılaştırılmıştır. Tüm kombinasyonların endeksin
yönünü tahmin etmede başarılı olduğu gözlemlenmiştir. Metinsel ve finansal veri setlerinden
ayrı ayrı elde edilen tahminlerin ortalama değerinin gerçek değeri tahmin etmede oldukça
başarılı olduğu görülmüştür.
Ulusal ve uluslararası literatürde, hisse senedi tahmini yapan çok sayıda çalışma
mevcuttur ancak ulusal yazında XBANK endeksini tahmin eden çalışmaların sınırlı sayıda
olduğu ve genellikle finansal göstergeler kullanılarak zaman serisi analizlerinin yapıldığı
belirlenmiştir. Ulusal yazın incelendiğinde, XBANK endeksinin tahmininde derin öğrenme
metotlarının kullanıldığı herhangi bir çalışmaya rastlanılmadığı, dahası metinsel veriler ve
finansal verilerin birlikte ele alındığı çalışmaların olmadığı görülmektedir. Bu açıdan tezde
yapılan araştırmanın ulusal literatüre katkı sağlayacağı düşünülmektedir. A stock market is an organized market where capital market instruments are bought and sold. Profit or loss is obtained after the investors carry out this trading process. With the investors having accurate predictions about the markets, the loss can be minimized. Predictions for financial markets are essential in the academic and business world. In this thesis, deep neural networks were proposed to predict the closing value of the bank index (XBANK), which is traded in the stock exchange. For this purpose, daily closing, opening, highest and lowest values, various technical indicators, various macroeconomic variables, and textual data about the bank index between 04.11.2015-04.11.2019 were used. Textual data contains news headlines and it was obtained by web scraping technique from two selected web sources. Three different data sets were prepared to be used in the analysis. The first is a combination of financial and textual data, the second is a data set created with financial data, and the third is a data set created only with textual data. The data sets were split into two parts: 70% as training and 30% as a test set. The features in the data sets that didn't have a positive effect on the model accuracy were excluded. This process is done by applying the Boruta algorithm. An optimization process was performed to find the hyperparameters used in the model training phase. The grid search method was used for this process. After determining the appropriate features and hyperparameters, the neural network was trained. The predictions were obtained for the test. Then, a feed-forward deep neural network was trained using selected features. viii The predictions for three different data sets were compared with the real values. The results show that, while the trend of the index is predicted correctly, there are deviations in point estimations. In particular, it was observed that the model is not able to provide accurate predictions for the time period between June and November 2019. There is a negative decomposition in the residuals which is the difference between the predicted values and the actual values. In order to understand the reason for the fluctuations in these periods, the news headlines in the textual data set were examined, and it was concluded that the political news in this period caused volatility, so the model could not provide accurate results for this time period. Based on the ensemble learning methodology the average values of the predictions for different combinations of three models were calculated and results were compared with the actual values. It was observed that all combinations predict the trend accurately. However, the average value of predictions obtained using only textual and only the financial data sets provide the most accurate predictions. There are many studies in the national and international literature that make forecasting of stocks, however studies that estimate the XBANK index in the national literature are limited. Studies estimating the XBANK index have generally made time series analysis using financial indicators. When the national literature is examined, there is no study in which deep learning methods are used in the estimation of the XBANK index also, it was observed that there were no studies in which textual and financial data were used together. Therefore it is thought that the research made in the thesis will contribute to the national literature. |
URI: | http://hdl.handle.net/11607/4518 |
Appears in Collections: | Yüksek Lisans |
Files in This Item:
File | Description | Size | Format | |
---|---|---|---|---|
3154.pdf | Cansu Altunbaş Yüksek Lisans Tez Dosyası | 3.5 MB | Adobe PDF | View/Open |
Items in DSpace are protected by copyright, with all rights reserved, unless otherwise indicated.