Association Rules Analysis with Apriori Algorithm and Data Visualization: Evidence from Borsa Istanbul
Öz
Considering that association analysis can be applied in finance, as it is in many fields, a study was conducted using stock prices. This study utilized two datasets covering the stocks included in the BIST TUM index and the BIST TUM-100 index, which were calculated within Borsa Istanbul. The data were analyzed using the Apriori algorithm and supported by data visualization techniques. The research used daily closing data of 421 companies in the BIST TUM index and 340 companies in the BIST TUM-100 index, obtained from the Finnet database. The data belongs to the period 10.01.2022/08.01.2024, and the association analysis was performed with stock closing prices according to the interestingness rule criteria. ARules () and ARulesViz () packages were used for the Apriori algorithm in the analysis performed in the R programming language, and Shiny () was used for the representation of codes and visuals. In Model 1, which is based on BIST TUM index stocks, 66 association rules were obtained, and in Model 2, which covers BIST TUM-100 index stocks, 34 association rules were obtained. The study concludes that all the parameters analyzed reveal significant and interesting rules, as statistically evidenced by Fisher’s exact p-values, indicating that the companies may be significantly related.
Anahtar Kelimeler
Portfolio Management, Data Mining, Apriori Algorithm, Fisher’s Exact Test, Interestingness Measures, Stocks
Proje Numarası
1129B372300796
Etik Beyan
Acknowledgments: The second author of the article has utilized the knowledge gained from the “TÜBİTAK 2237-A BİDEB Statistical Modeling Techniques and Applications in Natural Sciences (Project No:1129B372300796)” and “TÜBİTAK 2237-A BİDEB Natural Science-Based Exploratory Data Analysis and Data Visualisation (Project No:1129B372400933)” projects, supported by TÜBİTAK, during the article process.
Apriori Algoritması ile Birliktelik Kuralları Analizi ve Veri Görselleştirme: Borsa İstanbul Örneği
Öz
Birliktelik analizinin birçok alanda olduğu gibi finans alanında da uygulanabileceği düşünülerek, hisse senedi fiyatları kullanılarak, bir araştırma yapılmıştır. Bu çalışmada; Borsa İstanbul bünyesinde hesaplanan BIST TUM endeksi ve BIST TUM-100 endeksinde yer alan hisse senetlerini kapsayan iki veri seti kullanılmıştır. Veriler Apriori algoritması kullanılarak analiz edilmiş ve veri görselleştirme teknikleriyle desteklenmiştir. Araştırmada Finnet veri tabanından elde edilen BIST TUM endeksinde yer alan 421 şirket ile BIST TUM-100 endeksinde yer alan 340 şirketin günlük kapanış verileri kullanılmıştır. Veriler 10.01.2022/08.01.2024 dönemine ait olup, birliktelik analizi, ilginçlik ölçütlerine göre hisse senedi kapanış fiyatları ile gerçekleştirilmiştir. R programlama dilinde gerçekleştirilen analizlerde Apriori algoritması için ARules () ve ARulesViz () paketleri, kodların ve görsellerin gösterimi için ise Shiny () kullanılmıştır. BIST TUM endeksi hisse senetlerini kapsayan Model 1’de 66, BIST TUM-100 endeksi hisse senetlerini kapsayan Model 2’de ise 34 birliktelik kuralı elde edilmiştir. Çalışma, analiz edilen tüm parametrelerin, Fisher’in kesin p-değerleri ile istatistiksel olarak kanıtlandığını, şirketlerin önemli ölçüde ilişkili olabileceğini gösteren, önemli ve ilginç kuralları ortaya koyduğu sonucuna varmaktadır.
Anahtar Kelimeler
Portföy Yönetimi, Veri Madenciliği, Apriori Algoritması, Fisher’s Exact Test, İlginçlik Ölçütleri, Hisse Senetleri
Proje Numarası
1129B372300796