Source-linked AI summary
HATS: A Hierarchical Graph Attention Network for Stock Movement Prediction
Raehyun Kim, Chan Ho So, Minbyul Jeong, Sanghoon Lee, Jinkyu Kim, Jaewoo Kang
TL;DR
Relational stock prediction lacks effective selection across relation types and has largely focused on individual stocks. HATS hierarchically attends over relations for both stock and market-index prediction, outperforming existing methods while relying on pooling and network-construction choices open to improvement.
Problem
Relational stock prediction lacks systematic study of relation-type effects and selective aggregation, while prior work mainly addresses individual-stock node classification.
Method
HATS selectively aggregates information from different relation types into company representations and applies graph pooling for market-index prediction.
Results
HATS outperformed existing models, with 19.8% higher Sharpe ratio and 3% higher F1 score than existing baselines on S&P 500 stocks.
Takeaways & Limitations
Prediction performance depends on relational data, and automatically selecting information supports both individual-stock and market-index movement prediction.
Takeaways & Limitations
The study uses basic graph pooling and a WikiData-based network, while neighborhood construction and alternative data sources remain open to improvement.
Abstract
from arXiv · showhide
Many researchers both in academia and industry have long been interested in the stock market. Numerous approaches were developed to accurately predict future trends in stock prices. Recently, there has been a growing interest in utilizing graph-structured data in computer science research communities. Methods that use relational data for stock market prediction have been recently proposed, but they are still in their infancy. First, the quality of collected information from different types of relations can vary considerably. No existing work has focused on the effect of using different types of relations on stock market prediction or finding an effective way to selectively aggregate information on different relation types. Furthermore, existing works have focused on only individual stock prediction which is similar to the node classification task. To address this, we propose a hierarchical attention network for stock prediction (HATS) which uses relational data for stock market prediction. Our HATS method selectively aggregates information on different relation types and adds the information to the representations of each company. Specifically, node representations are initialized with features extracted from a feature extraction module. HATS is used as a relational modeling module with initialized node representations. Then, node representations with the added information are fed into a task-specific layer. Our method is used for predicting not only individual stock prices but also market index movements, which is similar to the graph classification task. The experimental results show that performance can change depending on the relational data used. HATS which can automatically select information outperformed all the existing methods.
1. Introduction
This section motivates relational stock prediction, identifies gaps in relation selection and graph-level forecasting, and introduces HATS with reported gains over existing baselines.
- Stock prediction is difficult but widely studied because systematic trading algorithms increasingly automate trading decisions.
- Existing relational methods use corporate networks, but prior work mainly addresses individual-stock prediction as node classification.
- Different relation types can affect prediction differently: relevant relations help, whereas irrelevant relations can degrade performance.
- HATS selectively aggregates information across relation types and adds it to company representations before task-specific prediction.
- The method extends stock prediction to both individual stocks and market indices by treating the latter as graph classification.
- 19.8% higher Sharpe ratio and 3% higher F1 score were reported than existing baselines on S&P 500 stocks.
2. Preliminaries
The preliminaries introduce graph representations and graph neural networks, contrasting spectral and neighborhood-based aggregation for node and graph classification.
- Graph Theory: A graph consists of vertices and edges, with an adjacency matrix encoding weighted connections between nodes.
- Graph Theory: Node features are represented in a feature matrix, and temporal graphs extend this representation across time steps.
- Graph Neural Networks: Graph neural networks learn graph representations through spectral or non-spectral methods.
- Graph Neural Networks: Spectral methods use graph convolutions, while non-spectral methods aggregate features from spatially close neighboring nodes.
- Graph Neural Networks: Spectral convolution filters can be approximated with Chebyshev polynomials to avoid expensive graph-Laplacian eigendecomposition.
- Graph Neural Networks: Attention mechanisms assign different weights to neighboring-node features, and updated node representations support node or graph classification.
3. Methodology
The framework extracts company-state features, selectively aggregates relational information with HATS, and feeds updated representations into stock- or index-prediction modules. HATS uses hierarchical attention to weight neighboring nodes and relation types, while index prediction additionally pools company representations.
- General framework: The framework uses feature extraction, relational modeling, and task-specific modules for stock prediction.Node features represent companies’ current states from historical movement patterns; relational modeling updates them before task-specific prediction.
- Feature Extraction Module: LSTM and GRU extract company-state representations from historical movement patterns.LSTM is used for individual stock prediction, while GRU is used for index movement prediction with graph pooling.
- Relational Modeling Module: HATS selectively aggregates information from neighboring nodes and different relation types using hierarchical attention.The first attention layer weights neighbors within a relation type, and the second assigns importance across relation types before adding aggregated information to node representations.
- Individual Stock Prediction: Individual stock prediction classifies each company into up, neutral, or down movement classes.The task uses a simple linear transformation layer and cross-entropy loss.
- Graph Pooling for Index Prediction: Index prediction aggregates updated company representations with mean pooling to represent the entire market graph.The pooled graph representation is combined with the index’s own feature representation before prediction.
- Graph Pooling for Index Prediction: The method uses basic graph pooling, leaving substantial room for improvement.The authors identify improved pooling methods as future work because this is the first application of graph pooling to stock prediction.
4. Data
The study uses U.S. stock-market data, corporate relations, and historical price-change features to evaluate individual companies and market conditions across varying volatility phases. Corporate relations are converted into a company-only graph using short meta-paths, with limitations in relation-network construction left for future work.
- Corporate Relation Data: The dataset contains 431 S&P-listed companies with corporate relations from a public database.Companies without any relation to others in the database were removed.
- Price Data: Price data span 1,174 trading days from 2013/02/08 to 2019/06/17.The sample includes several market crashes and is divided into phases with varying volatility.
- Price Features: Historical price change rates are used as the model’s input features.The model predicts the next-day price change rate from a sequence of historical rates.
- Corporate Relation Data: Corporate relational data are collected from Wikidata and transformed into company connections through meta-paths.The meta-path approach addresses sparse company-to-company edges in the heterogeneous knowledge base.
- Corporate Relation Data: The relation graph uses meta-paths with at most two hops to obtain a homogeneous company-only graph.The authors note that constructing corporate relational networks from large knowledge bases can be improved.
5. Experiments
The experiments examine how relation selection affects stock prediction across individual-stock and market-index tasks. HATS generally improves classification and profitability by selectively aggregating relational information, while irrelevant or fixed relations can reduce or destabilize performance.
- Experiment design: The experiments label price movements as up, neutral, or down using two thresholds, treating small changes as neutral and significant changes as directional.
- Relation analysis: Relation quality strongly affects prediction: irrelevant relations can degrade performance, while the best relation configuration is 6% higher than the worst.
- Relation analysis: Densely connected relations such as country and stock exchange can introduce noise and irrelevant information into target-node representations.
- Individual stock prediction: HATS generally outperformed all baselines on individual-stock prediction in both F1 score and accuracy, whereas some relational models improved accuracy but not F1.
- Individual stock prediction: HATS obtained good expected-return and Sharpe-ratio performance by selecting useful information according to market conditions, unlike static manually selected relations whose results varied widely.
- Market index prediction: On market-index prediction, HATS was the only model significantly better than LSTM in F1 score and accuracy, and outperformed all baselines on average.
6. Conclusion
HATS uses relational data to predict individual stock prices and market index movements by selectively aggregating information across relation types. The authors report that relation choice can dramatically affect performance, HATS outperformed existing models, and future work should improve network construction and graph pooling.
- 6. Conclusion: HATS selectively aggregates information across relation types to learn useful company representations for stock prediction.The model is applied to both individual stock-price prediction and market-index movement prediction.
- 6. Conclusion: Prediction performance can change dramatically depending on the relation type used.This finding underscores the importance of choosing appropriate relational data.
- 6. Conclusion: HATS automatically selects information and outperformed all existing models.
- 6. Conclusion: Future work could improve corporate-network construction, data sources, neighborhood definitions, and pooling methods.The study uses direct edges or meta-paths of at most 2 hops and a single WikiData database.
A. Appendix
Table 6 lists the relations used in the study, including both direct edges and meta-paths.
- A. Appendix: Table 6 lists the relations used in the study, including direct edges and meta-paths.