Geri Dön

Hisse senedi fiyat tahmininde otokodlayıcı ve graf evrişimli ağının uygulanması

Application of autoencoder and graph convolutional network in stock price prediction

  1. Tez No: 739931
  2. Yazar: MAHMUT LUTFULLAH ÖZBİLEN
  3. Danışmanlar: DOÇ. DR. YUSUF YASLAN
  4. Tez Türü: Yüksek Lisans
  5. Konular: Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve Kontrol, Computer Engineering and Computer Science and Control
  6. Anahtar Kelimeler: Belirtilmemiş.
  7. Yıl: 2022
  8. Dil: Türkçe
  9. Üniversite: İstanbul Teknik Üniversitesi
  10. Enstitü: Lisansüstü Eğitim Enstitüsü
  11. Ana Bilim Dalı: Bilgisayar Mühendisliği Ana Bilim Dalı
  12. Bilim Dalı: Bilgisayar Mühendisliği Bilim Dalı
  13. Sayfa Sayısı: 71

Özet

Finans alanında makine öğrenmesi ve derin öğrenme modellerinin kullanımı son yıllarda artmıştır. Makine öğrenmesi ve derin öğrenme yöntemleri, içerisinde bulunan lineer olmayan aktivasyon fonksiyonları ile finans verilerindeki lineer olmayan ilişkileri öğrenebilmektedir. Finans alanındaki en popüler problemlerden biri de borsadaki hisse senedi fiyatlarının tahminlenmesidir. Yapay Sinir Ağı (YSA) ve Karar Ağaçları Ormanı gibi klasik makine öğrenmesi yöntemleri özellikle 2000'li yıllarda sıklıkla kullanılmıştır. Derin öğrenme yöntemlerinin diğer alanlardaki başarısının artmasıyla birlikte başta yinelemeli sinir ağı modeli olan Uzun-Kısa Süreli Bellek (UKSB) olmak üzere birçok derin öğrenme yöntemi bu probleme çözüm olarak sunulmuştur. Hisse fiyatı serilerinin görüntülere dönüştürülmesiyle birlikte Otokodlayıcı gibi Evrişimli Sinir Ağı (ESA) tabanlı derin öğrenme yöntemleri de literatürde yer almaktadır. Hisselerin birbirleriyle ilişkilerinin kullanıldığı Graf Evrişimli Ağ (GEA) gibi graf tabanlı yöntemler de son yıllarda birçok çalışmada kullanılmıştır. Tez çalışmasında, gelecek hisse fiyatı tahminlemesinde Otokodlayıcı ve GEA yöntemlerinin ürettiği özniteliklerin UKSB ile birlikte kullanıldığı yöntemler sunulmuştur. Yatırımcıların karar alırken mum grafiklerini incelemesinden yola çıkılarak Otokodlayıcı ile mum grafiği görüntülerinden öznitelikler üretilmiştir. Bunun için hisse fiyat bilgilerinden mum grafiği görüntüleri üretilmiştir. Otokodlayıcı modeli girdi olarak bu görüntüleri almakta, kodlayıcı ağı ile bir öznitelik vektörü üretmekte ve kod çözücü ağıyla da vektörü kullanarak mum grafiğini tekrar oluşturmaktadır. Otokodlayıcının girdi olarak alınan mum grafiklerini tekrar oluşturabilmesi, kodlayıcı kısmının ürettiği öznitelik vektörün mum grafiğinden anlamlı bilgiler çıkardığını göstermektedir. Tez çalışmasında da bu üretilen öznitelik vektörü, UKSB ile birlikte iki farklı yöntemde fiyat tahminlemede kullanılmıştır. Otokodlayıcı+UKSB 1 adı verilen ilk yöntemde kodlayıcı tarafından üretilen öznitelik vektörü son 20 günlük fiyat serisine eklenmiş ve UKSB ağına girdi olarak verilmiştir. UKSB ile bu zaman serisi üzerinden fiyat tahmini yapılmıştır. Otokodlayıcı+UKSB 2 adı verilen ikinci yöntemde UKSB girdi olarak sadece 20 günlük fiyat verisini almıştır. UKSB'nin ürettiği öznitelik vektörüyle kodlayıcının ürettiği öznitelik vektörü birleştirilmiş ve YSA'ya ertesi günün fiyatının tahminlemesi için verilmiştir. Borsadaki firmaların gelecekteki fiyatlarının ilişkili olduğu diğer firmalarla bağlantılı olduğundan hareketle GEA ile öznitelik çıkarımı yapılmıştır. Düğümleri hisse senetleri ve kenarları firmaların ilişkileri olan bir graf oluşturulmuştur. Düğümlerin özniteliği olarak her firmanın geçmiş fiyatlarından elde edilen teknik göstergeler kullanılmıştır. Düğümler arasındaki kenarlar da geçmiş hisse senedi fiyatlarının korelasyonu ile kurulmuştur. Graf evrişimli ağlar ile borsadaki her firma için öznitelikler oluşturulmuştur. Bu özniteliklerde hisse senetlerinin ilişkilerinin olduğu diğer hisse senetlerinden de bilgiler bulunmaktadır. GEA ile borsa grafından elde edilen özniteliklerin kullanıldığı iki fiyat tahminleme yöntemi önerilmiştir. GEA+UKSB 1 yönteminde Otokodlayıcı+UKSB 1 yöntemindeki gibi GEA tarafından üretilen öznitelik vektörü 20 günlük fiyat serisine eklenmiş ve UKSB'ye beslenmiştir. GEA+UKSB 2 yönteminde de üretilen öznitelik vektörü UKSB'nin sadece geçmiş fiyatları kullanarak ürettiği öznitelikle birleştirilip YSA'ya girdi olarak verilmiş ve hisse senedi fiyatı tahmin edilmiştir. Tez çalışması kapsamında önerilen son yöntemde Otokodlayıcı, GEA ve UKSB tarafından üretilen öznitelikler birleştirilmiştir. Birleştirilen zengin öznitelik vektörü YSA'ya beslenmiş ve fiyat tahmini yapılmıştır. Bu yönteme Otokodlayıcı+GEA+UKSB adı verilmiştir. Önerilen yöntemlerin performansları Standard & Poor 500 (S&P 500) borsasındaki veriler üzerinde test edilmiştir. Yöntemleri karşılaştırmak için sadece 20 günlük fiyat verileriyle eğitilmiş UKSB modeli kullanılmıştır. Yöntemlerin tahmin performansları R² skoru, ortalama mutlak hata (OMH), ortalama mutlak yüzde hata (OMYH) ve ortalama kare hata (OKH) metriklerine göre değerlendirilmiştir. Otokodlayıcı, GEA ve UKSB özniteliklerini birlikte kullanan Otokodlayıcı+GEA+UKSB yöntemi R² skor ve OKH bazında en iyi sonuçları elde etmiştir. Otokodlayıcı+UKSB 1 yöntemi OMH bazında ve GEA+UKSB 2 yöntemi de OMYH bazında en iyi sonuçları elde etmiştir. Tez çalışması kapsamında yapılan deneylerde önerilen yöntemler saf UKSB modeline göre daha iyi sonuçlar elde etmiştir. Bu durum, UKSB modellerini mum grafikleri ve borsa grafları gibi farklı kaynaklardan elde edilen özniteliklerle birlikte kullanmanın modellerin hisse fiyatı tahmin kapasitesini arttırabileceğini göstermektedir.

Özet (Çeviri)

The use of machine learning and deep learning models in finance has increased in recent years. The main reason for this is that machine learning and deep learning algorithms are successful in learning nonlinear relationships in financial data. One of the most popular problems in finance is predicting stock prices in the stock market. Past studies stated that stock price movements are like random walks that cannot be predictable. Yet it has been the main focus of much study in this area. The motivation for these studies is the idea that predicting stock prices will help investors in their investments. In the first studies on predicting stock prices, linear statistical methods such as autoregressive integrated moving average (ARIMA) were frequently used. Then, in the researches conducted in the 2000s, machine learning methods such as Artificial Neural Network (ANN), Random Forest and Support Vector Machine performed better as they were able to capture nonlinear information that linear statistical methods could not. With the increase in the success of deep learning methods in other fields, deep learning methods have been presented as a solution to this problem. Long-Short Term Memory (LSTM) and Gated Recurrent Unit (GRU), which are improved versions of Recurrent Neural Network (RNN), have been the primary choice for this problem since they are designed to perform on time series data. Convolutional Neural Network-based deep learning methods such as Autoencoder were also used to solve this problem, with the conversion of stock price series to images and extracting features from those images. Graph-based methods such as Graph Convolutional Network (GCN), in which the relations between stocks are used, have also been utilized in many studies in recent years. In this thesis, several methods are presented in which using features extracted by Autoencoder and GCN. Autoencoder extracted the features from the candlestick charts while the GCN extracted the features from the stock graph. Additional features were used together with LSTM to predict the future stock price. Candlestick charts are generated with opening, closing, minimum and maximum price of a stock. They are used by investors while making a decision about a stock. In this study, features were extracted from the images of the candlestick charts with the Autoencoder to get the semantic information. For this, candlestick images were generated from stock prices. Autoencoder model takes these images as input, generates feature vectors with the encoder, and creates candlestick charts by using the vector with the decoder. Autoencoder regenerating candlestick charts means that the feature vector produced by the encoder contains semantic information from the candlestick. Encoder and decoder networks can be formed by ANNs or CNNs. In this study, 4 fully connected layered ANNs were used to construct the encoder and decoder network. Autoencoder was trained until it generates similar outputs to inputs. In the next step, extracted feature vector was used in price prediction with LSTM in two different methods. In the first method called Autoencoder+LSTM 1, the feature vector produced by the encoder was added to the price series of the last 20 days and given as an input to the LSTM network. Price prediction was made with LSTM over this time series which contains historical price information and semantic information. In the second method, called Autoencoder+LSTM 2, LSTM took only last 20 days' price data as input. The feature vector produced by the LSTM and the feature vector produced by the encoder were combined and given to the ANN for prediction of the next day's price. Graph convolutional networks can generate embeddings from graphs for each node, taking into account features at adjacent nodes. In the thesis, features were extracted from stock graph with the help of a GCN, considering that the future prices of the stocks are also related to other stocks. First, stock graph is constructed where nodes represent stocks and edges were the relationships between stocks. As a node feature, the Exponential Moving Average and Momentum Indicator technical indicators were used to provide additional information to the model apart from the historical raw prices. Edges between nodes were established by Pearson product-moment correlation of past stock prices. Since the correlation can take a value between -1 and 1, the edges are created with weights that are the absolute value of the correlation. Absolute values were taken since the high negative correlation between the nodes also indicates a strong connection. Features were created for each firm in the stock market with GCN with 3 graph convolutional layers. Two methods have been proposed that uses features obtained from the stock market graph with GCN. In the GCN+LSTM 1 method, as in the Autoencoder+LSTM 1 method, the feature vector produced by GCN was added to the 20-day price series and fed to the LSTM. With this way, LSTM input would have both stock relations information and historical stock price information. The feature vector produced in the GCN+LSTM 2 method was combined with the feature produced by LSTM using only past prices and given as input to the ANN and the stock price was predicted. In the last method proposed within the scope of the thesis, the features produced by Autoencoder, GCN and LSTM were combined. The combined rich feature vector was fed to the ANN and the price was predicted. This method was called Autoencoder+GCN+LSTM. The performances of the proposed methods had been tested on data from the Standard & Poor 500 (S&P 500) exchange. Stock prices from 2013-02-08 to 2018-02-07 were used. Dataset contains stock prices of 470 firm for 1259 trading days. LSTM trained using only 20 days of price data was chosen as the benchmark method, to see if additional features improve the performance of LSTM in recommended methods. The prediction performances of the methods were evaluated according to the R² score, mean absolute error (MAE), mean absolute percentage error (MAPE), and mean square error (MSE). Autoencoder+GCN+LSTM method, which uses Autoencoder, GCN and LSTM features together, achieved the best results in terms of R² score and MSE. Autoencoder+LSTM 1 method achieved the best results on the basis of MAE and GCN+LSTM 2 method achieved the best results on the basis of MAPE. In this thesis, 5 stock price prediction methods are presented and evaluated on the S&P 500 dataset. In the experiments, the proposed methods achieve better results than the pure LSTM model. This shows that using LSTM models with features obtained from different sources such as candlestick charts and stock market graphs can increase the stock price prediction capacity of the models.

Benzer Tezler

  1. Hisse senedi fiyat tahmininde ekonometrik ve makine öğrenme yöntemlerinin karşılaştırılması: BIST bankacılık uygulaması

    Comparison of econometric and machine learning methods in forecasting stock price: An application on BIST banking

    KORAY YAPA

    Doktora

    Türkçe

    Türkçe

    2022

    EkonometriUşak Üniversitesi

    İşletme Ana Bilim Dalı

    DOÇ. DR. NEZİH TAYYAR

  2. Hisse senedi fiyat tahminlerinde bilgi işlemsel zeka yöntemleri: Uzman bir sistem aracılığıyla BİSTt uygulaması

    Computational intelligence techniques in forecasting stock prices: ISE application with an expert system

    MEHMET ÖZÇALICI

    Doktora

    Türkçe

    Türkçe

    2015

    İstatistikKahramanmaraş Sütçü İmam Üniversitesi

    İşletme Ana Bilim Dalı

    DOÇ. DR. YÜCEL AYRIÇAY

  3. Hisse senedi fiyat hareketlerinin tahmini için makine öğrenim teknikleri ile derinlik ve teknik analizi entegre eden hibrit ve güvenilir bir yöntem

    A hybrid and reliable method integrating depth and technical analysis with machine learning techniques for predicting stock prices

    SEÇİL TABUROĞLU

    Yüksek Lisans

    İngilizce

    İngilizce

    2019

    Bilgisayar Mühendisliği Bilimleri-Bilgisayar ve KontrolHacettepe Üniversitesi

    Bilgisayar Mühendisliği Ana Bilim Dalı

    DR. ÖĞR. ÜYESİ FUAT AKAL

  4. Finansal alanda yapay zekâ: Makine öğrenmesi algoritmalarıyla hisse senedi fiyat tahmini

    Artificial intelligence in finance: Stock price prediction with machine learning algorithms

    SHAHIDA BARATOVA

    Yüksek Lisans

    Türkçe

    Türkçe

    2024

    İşletmeDokuz Eylül Üniversitesi

    İşletme Ana Bilim Dalı

    PROF. DR. SEVİNÇ GÜLER ÖZÇALIK

  5. Borsa İstanbul'da kote bireysel emeklilik, hayat ve hayat-dışı sigorta şirketlerinin hisse senedi fiyat tahmininde box-jenkins yöntemi

    Box-jenkins method on prediction of price of life, non-life and pension insurance shares quoted on Istanbul Stock Market

    FATMA ESİN KURT

    Doktora

    Türkçe

    Türkçe

    2018

    SigortacılıkSüleyman Demirel Üniversitesi

    İşletme Ana Bilim Dalı

    DOÇ. DR. SERPİL SENAL