Source-linked AI summary
Temporal Relational Ranking for Stock Prediction
Fuli Feng, Xiangnan He, Xiang Wang, Cheng Luo, Yiqun Liu, Tat-Seng Chua
TL;DR
Existing stock-prediction methods often optimize classification or regression and treat stocks independently, rather than directly targeting profitable ranking with relational information. The paper proposes Relational Stock Ranking with Temporal Graph Convolution to model rankings and time-sensitive stock relations, evaluating it on NYSE and NASDAQ. RSR outperforms the S&P 500 Index with significantly higher return ratio across three back-testing strategies, while the experiments also report average return ratios of 98% on NYSE and 71% on NASDAQ.
Problem
Existing methods may optimize classification or regression instead of stock selection and typically ignore relations among stocks.
Method
RSR formulates stock prediction as a ranking task and uses Temporal Graph Convolution to encode stock relations in a time-sensitive way.
Results
RSR outperforms the S&P 500 Index with significantly higher return ratio across three back-testing strategies.
Takeaways & Limitations
The results demonstrate the effectiveness of learning-to-rank methods for stock prediction on NASDAQ and NYSE.
Takeaways & Limitations
Selecting only one stock from more than 1,000 is highly risky, as cumulative-return curves are volatile.
Abstract
from arXiv · showhide
Stock prediction aims to predict the future trends of a stock in order to help investors to make good investment decisions. Traditional solutions for stock prediction are based on time-series models. With the recent success of deep neural networks in modeling sequential data, deep learning has become a promising choice for stock prediction. However, most existing deep learning solutions are not optimized towards the target of investment, i.e., selecting the best stock with the highest expected revenue. Specifically, they typically formulate stock prediction as a classification (to predict stock trend) or a regression problem (to predict stock price). More importantly, they largely treat the stocks as independent of each other. The valuable signal in the rich relations between stocks (or companies), such as two stocks are in the same sector and two companies have a supplier-customer relation, is not considered. In this work, we contribute a new deep learning solution, named Relational Stock Ranking (RSR), for stock prediction. Our RSR method advances existing solutions in two major aspects: 1) tailoring the deep learning models for stock ranking, and 2) capturing the stock relations in a time-sensitive manner. The key novelty of our work is the proposal of a new component in neural network modeling, named Temporal Graph Convolution, which jointly models the temporal evolution and relation network of stocks. To validate our method, we perform back-testing on the historical data of two stock markets, NYSE and NASDAQ. Extensive experiments demonstrate the superiority of our RSR method. It outperforms state-of-the-art stock prediction solutions achieving an average return ratio of 98% and 71% on NYSE and NASDAQ, respectively.
1 INTRODUCTION
Stock prediction methods often optimize forecasting accuracy rather than profitable stock selection and commonly ignore relations among stocks. RSR addresses both issues by learning stock rankings and modeling time-sensitive stock relations with Temporal Graph Convolution.
- Motivation: Classification and regression objectives may select less profitable stocks even when their prediction error is lower.Table 1 contrasts smaller price-change MSE with smaller investment profit.
- Motivation: Existing neural-network solutions typically treat stocks as independent and omit potentially informative company and stock relations.Examples include shared sectors or industries and supplier-customer connections.
- Proposed approach: RSR formulates stock prediction as a ranking task that directly predicts a stock list ordered by desired criteria such as return ratio.The ranking function maps multiple stocks to scores intended to reflect future investment revenue.
- Proposed approach: Temporal Graph Convolution captures stock relations in a time-sensitive manner within the neural-network framework.RSR combines sequential embeddings from historical data with relational embeddings before producing ranking scores.
- Evaluation: The method is evaluated through back-testing on NYSE and NASDAQ historical data.The paper presents the evaluation as empirical validation on two real-world stock markets.
2 PRELIMINARIES
The preliminaries introduce LSTM networks for sequential modeling and graph-based learning for exploiting entity relations. They also describe graph convolution as a localized graph operation and its standard efficient formulation.
- LSTM: LSTM networks process sequential data by evolving hidden states and using cell states to capture dependencies through time.The preliminaries contrast LSTM with vanilla RNNs and describe its gates and memory updates.
- Graph-based learning: Graph-based learning combines a task-specific prediction loss with graph regularization that encourages related entities to have similar predictions.The balance between the two terms is controlled by the hyperparameter λ.
- Graph-based learning: The graph regularizer uses pairwise entity similarity and degree normalization, equivalently represented through the graph Laplacian matrix.The adjacency matrix contains pairwise similarities, while L is the normalized graph Laplacian.
- Graph Convolutional Networks: Graph Convolutional Networks apply convolution to capture local connection patterns on graphs while incorporating the graph smoothness assumption.The formulation is motivated by the analogy between graph-local structure and local patterns captured by CNNs.
- Graph Convolutional Networks: Chebyshev-polynomial approximation avoids eigendecomposition overhead, and setting K to 1 yields the standard operation f(F, X) = AX.The resulting convolution can be injected into a fully connected layer as A(XW + b).
3 RELATIONAL STOCK RANKING
RSR formulates stock prediction as ranking and combines temporal stock representations with explicit, time-sensitive stock relations. Its three-layer framework uses LSTM embeddings, Temporal Graph Convolution, and a ranking-oriented prediction objective.
- Overall Framework: RSR directly predicts a ranked stock list according to criteria such as return ratio, rather than classifying price movement or regressing price.The framework targets stock selection by predicting ranking scores and generating a recommended buy list.
- Sequential Embedding Layer: The sequential embedding layer applies an LSTM to each stock’s historical time series and uses its last hidden state as the stock embedding.The embeddings of all stocks are collected in E_t, with U denoting the LSTM hidden-unit or embedding size.
- Optimization: RSR combines pointwise regression and pairwise max-margin ranking losses, using 1-day return ratio as the ground-truth target.The pairwise term encourages predicted stock-pair orders to match the ground-truth order.
- Relational Embedding Layer: The relational embedding layer applies Temporal Graph Convolution to sequential embeddings and multi-hot relation encodings to learn revised embeddings containing relation information.Relations include examples such as sector, industry, and supplier-consumer connections.
- Temporal Graph Convolution: Temporal Graph Convolution propagates embeddings across related stocks, while weighted propagation learns different impacts for different relation vectors.Uniform propagation considers connected stocks, whereas weighted propagation uses a learnable relation-strength function.
- Temporal Graph Convolution: Temporal Graph Convolution generalizes conventional GCN by modeling temporal patterns instead of using a fixed adjacency matrix.Its relation strengths can evolve with stock status across time-steps.
4 DATA COLLECTION
The study constructs NASDAQ and NYSE datasets from historical prices and company relations, with chronological splits for training, validation, and evaluation. It represents both sector-industry structure and Wikidata relations between companies.
- 3,274 NASDAQ and 3,163 NYSE stocks with transaction records were collected between 01/02/2013 and 12/08/2017.
- The experiments retain 1,026 NASDAQ and 1,737 NYSE stocks after excluding stocks considered too risky for general investors.The retained stocks include historical prices, sector-industry relations, and Wikidata company relations.
- Daily stock rankings target each stock’s 1-day return ratio, using historical data from the preceding S trading days.
- Historical data are chronologically split into training (2013–2015), validation (2016), and evaluation (2017), containing 756, 252, and 237 trading days, respectively.
- Sector-industry relations: Sector-industry relations connect stocks classified under the same industry node within the NASDAQ and NYSE hierarchies.
- Wiki company-based relations: Wikidata supplies first-order and second-order company relations; 42 relation types occur between NASDAQ stock pairs and 32 between NYSE stock pairs.First-order relations directly connect companies, while second-order relations arise when their statements share an object.
5 EXPERIMENT
The experiments evaluate stock ranking, relational modeling, and back-testing strategies across NYSE and NASDAQ. Results support ranking-based prediction, temporal relation modeling, and market-dependent relation choices, while also exposing volatility and validation–testing differences.
- RQ1: Stock Ranking Formulation: Rank_LSTM improves IRR by more than 14% over SFM and LSTM on both markets, supporting stock ranking as a promising formulation.However, Rank_LSTM does not consistently outperform the baselines on every measure; its NYSE MRR is worse than SFM.
- RQ1: Stock Ranking Formulation: IRR varies substantially across runs because small changes in the top-two ranking can strongly affect returns when daily return ratios range from 0 to 0.98.The authors therefore identify top-ranked-stock learning as a worthwhile direction for future work.
- RQ3: Back-testing Strategies: Cumulative-return curves are volatile, and selecting one stock from more than 1,000 is characterized as highly risky.The authors suggest introducing risk-oriented criteria into future stock-ranking tasks.
- RQ2: Impact of Stock Relations: All relation-aware methods outperform Rank_LSTM on NYSE IRR, indicating that encoding stock relations benefits stock prediction there.The compared relation-aware methods are GBR, GCN, RSR_E, and RSR_I.
- RQ2: Impact of Stock Relations: RSR_E and RSR_I improve over GBR and GCN, supporting Temporal Graph Convolution over conventional static relation modeling.GBR and GCN use static graphs, whereas the proposed TGC models temporal properties of stock relations.
- RQ2: Impact of Stock Relations: On NYSE, all Wiki-relation methods improve over Rank_LSTM by more than 0.09 IRR, with RSR_E and RSR_I achieving the best IRR in all cases.The associated back-testing procedure shows trends similar to those for industry relations.
- RQ2: Impact of Stock Relations: Considering stock relations is especially helpful on stable markets such as NYSE, while industry relations are suboptimal for NASDAQ.The authors also conclude that relation types should be chosen to suit the target market.
6 RELATED WORK
Prior stock-prediction work mainly uses regression or classification and generally fails to model revenue-based rankings and stock relations together. Graph-based and knowledge-graph methods provide relational modeling foundations, but the paper identifies learning-to-rank with integrated stock relations as its novel direction.
- Existing stock-prediction research primarily addresses stock price regression or stock trend classification.
- Prior methods do not incorporate the relative order of stocks by expected revenue, which can produce suboptimal stock selections.
- Existing solutions either ignore stock relations or model them heuristically, such as training separate predictors for stocks in each sector.
- The paper presents learning-to-rank as a first approach for stock prediction that injects stock relations through a new neural-network component.
- Graph-based learning commonly uses graph regularization or graph convolution to incorporate relationships among entities into target-task learning.
- Knowledge graph embedding represents entities and relations with vectors or matrices and transfers entity embeddings through addition or multiplication.
7 CONCLUSIONS
The paper formulates stock prediction as ranking and proposes Relational Stock Ranking with Temporal Graph Convolution to encode time-sensitive stock interactions. Experiments on NASDAQ and NYSE report higher return ratios than the S&P 500 Index across three back-testing strategies.
- RSR formulates stock prediction as a ranking task and uses learning-to-rank methods to predict stocks.
- Temporal Graph Convolution encodes the impact between stocks by modeling their relations in a time-sensitive way.
- The paper identifies risk-sensitive ranking, additional investment operations, alternative data, and broader relational-data applications as future directions.
A STOCK RELATION
The appendix describes the stock relations used in the collected data, including sector-industry relations and Wiki company-based relations.
- The collected data includes sector-industry relations and Wiki company-based relations between stocks or companies.
- These stock-relation details are documented in the appendix as part of the dataset description.
- The relation types provide the structured relational data used to characterize connections among selected stocks.
A.1 Sector-Industry Relation
The appendix reports industry-relation coverage for selected NASDAQ and NYSE stocks and lists the industry categories represented in each market’s classification data.
- A.1 Sector-Industry Relation: 112 NASDAQ and 130 NYSE industry-relation types are extracted from the companies’ classification hierarchy structures.
- A.1 Sector-Industry Relation: Table 11 documents industry relations among 1,026 selected NASDAQ stocks.
- A.1 Sector-Industry Relation: Additional listed categories include biotechnology, electrical products, railroads, aerospace, industrial machinery, automotive industries, and steel or iron ore.
- A.1 Sector-Industry Relation: The listed NASDAQ categories include computer manufacturing, software, semiconductors, data processing, and related communications and services.
- A.1 Sector-Industry Relation: Table 12 documents industry relations among 1,737 selected NYSE stocks.
- A.1 Sector-Industry Relation: The listed NYSE categories include package goods, forest products, precious metals, environmental services, chemicals, construction, metals, and textiles.
- A.1 Sector-Industry Relation: The industry listings also include advertising, diversified commercial services, professional services, broadcasting equipment, and computer-related retail.
A.2 Wiki Company-based Relations
The paper extracts company-based relations from Wikidata for selected NASDAQ and NYSE stocks, covering first-order links between companies and second-order links bridged by another entity. Tables 13 and 14 summarize these two relation types and their relation-property combinations.
- First-order relations: First-order relations directly connect two company entities as A ○ R→B○.Table 13 summarizes these direct company-to-company relations.
- Relation extraction: Wikidata supplies company-based relations for companies corresponding to selected NASDAQ and NYSE stocks.The extracted relation data comes from an open-domain knowledge base.
- Second-order relations: Second-order relations connect two company entities through a bridging entity C, represented as A ○ R1→C○ R2←B○.Table 14 summarizes the extracted second-order relations.
- Relation inventory: The relation inventory includes ownership, subsidiaries, parent organizations, board membership, executive leadership, industry, and other Wikidata properties.Examples include Owned by, Subsidiary, Parent organization, Board member, Chief executive officer, Industry, and Instance of.
- Relation inventory: The second-order relation set combines property pairs such as Industry with Instance of and Use with Instance of.These combinations are listed among the extracted company-based relation patterns.