KR102755618B1 - Method and apparatus for determining stock investment portfolio - Google Patents

Method and apparatus for determining stock investment portfolio Download PDF

Info

Publication number
KR102755618B1
KR102755618B1 KR1020230027038A KR20230027038A KR102755618B1 KR 102755618 B1 KR102755618 B1 KR 102755618B1 KR 1020230027038 A KR1020230027038 A KR 1020230027038A KR 20230027038 A KR20230027038 A KR 20230027038A KR 102755618 B1 KR102755618 B1 KR 102755618B1
Authority
KR
South Korea
Prior art keywords
features
stock
stocks
model
predicted
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
KR1020230027038A
Other languages
Korean (ko)
Other versions
KR20240133281A (en
Inventor
이기훈
김상호
김재승
Original Assignee
광운대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 광운대학교 산학협력단 filed Critical 광운대학교 산학협력단
Priority to KR1020230027038A priority Critical patent/KR102755618B1/en
Publication of KR20240133281A publication Critical patent/KR20240133281A/en
Application granted granted Critical
Publication of KR102755618B1 publication Critical patent/KR102755618B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/06Asset management; Financial planning or analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/088Non-supervised learning, e.g. competitive learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/09Supervised learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Technology Law (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Human Resources & Organizations (AREA)
  • Operations Research (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

본 발명에 따른 주식 투자 포트폴리오 결정 방법은, 주식 데이터로부터, 단순 그래프 기반 랭킹 모델 및 하이퍼그래프 기반 랭킹 모델을 통해 각각 복수의 주식들에 대한 랭킹을 예측하는 단계; 상기 주식 데이터로부터, 분류 모델을 통해 상기 복수의 주식들 각각에 대한 상승 확률을 예측하고, 회귀 모델을 통해 상기 복수의 주식들 각각에 대한 수익률을 예측하는 단계; 및 상기 단순 그래프 기반 랭킹 모델을 통해 예측된 랭킹과 상기 하이퍼그래프 기반 랭킹 모델을 통해 예측된 랭킹을 이용하여 주식들을 선택하는 단계; 및 상기 선택된 주식들에 대한 상기 예측된 상승 확률과 상기 예측된 수익률을 이용하여, 상기 선택된 주식들에 대한 투자 비율을 결정하는 단계를 포함하는 것을 특징으로 한다.A method for determining a stock investment portfolio according to the present invention comprises: a step of predicting a ranking for each of a plurality of stocks from stock data using a simple graph-based ranking model and a hypergraph-based ranking model; a step of predicting an increase probability for each of the plurality of stocks from the stock data using a classification model, and a step of predicting a return rate for each of the plurality of stocks using a regression model; and a step of selecting stocks using the ranking predicted through the simple graph-based ranking model and the ranking predicted through the hypergraph-based ranking model; and a step of determining an investment ratio for the selected stocks using the predicted increase probability and the predicted return rate for the selected stocks.

Figure R1020230027038
Figure R1020230027038

Description

주식 투자 포트폴리오 결정 방법 및 장치{METHOD AND APPARATUS FOR DETERMINING STOCK INVESTMENT PORTFOLIO}METHOD AND APPARATUS FOR DETERMINING STOCK INVESTMENT PORTFOLIO

본 발명은 딥러닝 기반의 주식 투자 포트폴리오 결정 방법 및 장치에 관한 것이다.The present invention relates to a method and device for determining a stock investment portfolio based on deep learning.

주식 포트폴리오는 다양한 주식의 조합으로, 투자자는 효과적인 포트폴리오 관리를 통해 위험을 줄이고 수익률을 극대화할 수 있다. 포트폴리오 관리는 종목 선정과 종목 배분으로 분류할 수 있다. 종목 선정은 기대 수익률이 높은 종목을 선별하는 것이고, 종목 배분은 선정된 종목에 대한 투자 비율을 결정하는 것이다.A stock portfolio is a combination of various stocks, and investors can reduce risk and maximize returns through effective portfolio management. Portfolio management can be classified into stock selection and stock allocation. Stock selection is selecting stocks with high expected returns, and stock allocation is determining the investment ratio for the selected stocks.

딥 러닝을 사용한 기존의 포트폴리오 관리 방법은, 개별 주식의 미래 추세 또는 가격을 예측하고 상승 가능성이 가장 높거나 수익률이 가장 높은 상위 순위의 종목을 선택하거나, 랭킹이 높을수록 더 높은 수익률을 달성할 것으로 기대되는, 주식의 랭킹 리스트를 예측하여 종목을 선택하는 접근 방식을 채택해 왔다.Traditional portfolio management methods using deep learning have adopted approaches that predict future trends or prices of individual stocks and select the top-ranked stocks with the highest potential for growth or highest returns, or predict a ranked list of stocks that are expected to achieve higher returns as they are ranked higher.

그러나 기존의 연구는 종목 선정의 문제와 달리, 딥 러닝 기반의 종목 배분은 고려하지 않고 있다. However, unlike the problem of stock selection, existing studies do not consider stock allocation based on deep learning.

본 발명이 해결하고자 하는 과제는, 딥 러닝 기반으로 주식 선정 뿐만 아니라 선정된 주식에 대한 투자 비율도 결정할 수 있는 딥 러닝 기반의 주식 투자 포트폴리오 결정 방법 및 장치를 제공하는 데 있다.The problem to be solved by the present invention is to provide a method and device for determining a stock investment portfolio based on deep learning, which can not only select stocks based on deep learning, but also determine an investment ratio for the selected stocks.

본 발명의 해결하고자 하는 과제는 이상에서 언급한 과제로 제한되지 않으며, 언급되지 않은 또 다른 과제들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.The problems to be solved by the present invention are not limited to the problems mentioned above, and other problems not mentioned will be clearly understood by those skilled in the art from the description below.

상기 기술적 과제를 해결하기 위한 본 발명에 따른 주식 투자 포트폴리오 결정 방법은, 주식 데이터로부터, 단순 그래프 기반 랭킹 모델 및 하이퍼그래프 기반 랭킹 모델을 통해 각각 복수의 주식들에 대한 랭킹을 예측하는 단계; 상기 주식 데이터로부터, 분류 모델을 통해 상기 복수의 주식들 각각에 대한 상승 확률을 예측하고, 회귀 모델을 통해 상기 복수의 주식들 각각에 대한 수익률을 예측하는 단계; 및 상기 단순 그래프 기반 랭킹 모델을 통해 예측된 랭킹과 상기 하이퍼그래프 기반 랭킹 모델을 통해 예측된 랭킹을 이용하여 주식들을 선택하는 단계; 및 상기 선택된 주식들에 대한 상기 예측된 상승 확률과 상기 예측된 수익률을 이용하여, 상기 선택된 주식들에 대한 투자 비율을 결정하는 단계를 포함하는 것을 특징으로 한다.According to the present invention for solving the above technical problem, a method for determining a stock investment portfolio comprises the steps of: predicting a ranking for each of a plurality of stocks from stock data using a simple graph-based ranking model and a hypergraph-based ranking model; predicting an increase probability for each of the plurality of stocks from the stock data using a classification model, and predicting a return rate for each of the plurality of stocks using a regression model; and selecting stocks using the ranking predicted through the simple graph-based ranking model and the ranking predicted through the hypergraph-based ranking model; and determining an investment ratio for the selected stocks using the predicted increase probability and the predicted return rate for the selected stocks.

상기 선택하는 단계는, 상기 단순 그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식과 상기 하이퍼그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식으로부터 주식들을 선택할 수 있다.The above-mentioned selecting step can select stocks from a top predetermined number of stocks predicted through the simple graph-based ranking model and a top predetermined number of stocks predicted through the hypergraph-based ranking model.

상기 선택하는 단계는, 상기 단순 그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식과 상기 하이퍼그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식을 교집합하여 주식들을 선택할 수 있다.The above-mentioned selecting step can select stocks by intersecting a top predetermined number of stocks predicted through the simple graph-based ranking model and a top predetermined number of stocks predicted through the hypergraph-based ranking model.

상기 결정하는 단계는, 상기 선택된 주식들에 대한 상기 예측된 상승 확률과 상기 예측된 수익률의 요소별 곱셈을 이용하여 투자 비율을 결정할 수 있다.The above-determining step can determine the investment ratio by using the factor-by-factor multiplication of the predicted increase probability and the predicted return for the selected stocks.

주식 투자 포트폴리오 결정 방법은, 상기 주식 데이터를 전처리하는 단계로서, 상기 주식 데이터로부터 캔들스틱 구성요소와 기술적 지표를 포함하는 특징들을 계산하고, 상기 특징들을 클러스터링하고, 클러스터 내의 특징들의 수가 소정 임계값보다 큰 각 클러스터 내의 특징들을 선택하고, 상기 선택된 특징들을 병합하는 전처리 단계를 더 포함할 수 있다.The method for determining a stock investment portfolio may further include a preprocessing step of calculating features including candlestick components and technical indicators from the stock data, clustering the features, selecting features within each cluster in which the number of features within the cluster is greater than a predetermined threshold, and merging the selected features, as a step of preprocessing the stock data.

상기 전처리 단계는, 상기 병합된 특징들의 차원을 축소하고, 차원이 축소된 특징들이 상기 분류 모델 및 상기 회귀 모델에 사용될 수 있다.The above preprocessing step reduces the dimension of the merged features, and the dimension-reduced features can be used in the classification model and the regression model.

상기 전처리 단계는, 각 주식에 대하여, 분류 모델에 대하여 병합된 특징과 회귀 모델에 대하여 병합된 특징을 교집합하여 공통 특징을 획득하고, 상기 각 주식에 대한 공통 특징을 결합하여 빈도가 높은 소정 개수의 특징을 선택하고, 상기 선택된 특징이 상기 단순 그래프 기반 랭킹 모델 및 상기 하이퍼그래프 기반 랭킹 모델에 사용될 수 있다.The above preprocessing step obtains common features by intersecting the merged features for the classification model and the merged features for the regression model for each stock, and selects a predetermined number of features with high frequency by combining the common features for each stock, and the selected features can be used in the simple graph-based ranking model and the hypergraph-based ranking model.

상기 주식 투자 포트폴리오 결정 방법은, 상기 주식 데이터로부터 추출된 특징으로 구성되는 시계열 특징으로부터 LSTM(Long Short-Term Memory) 기반 시간적 모델을 통해 시간적 특징을 추출하는 단계를 더 포함하고, 상기 랭킹을 예측하는 단계 및 상기 상승 확률 및 상기 수익률을 예측하는 단계는, 상기 시간적 특징으로부터 예측할 수 있다.The above stock investment portfolio determination method further includes a step of extracting temporal features from time series features composed of features extracted from the stock data through a LSTM (Long Short-Term Memory) based temporal model, and the step of predicting the ranking and the step of predicting the probability of increase and the rate of return can be predicted from the temporal features.

상기 시간적 특징을 추출하는 단계는, 상기 시계열 특징에 LSTM 계층과 Hawkes 어텐션 메커니즘을 적용하고, 각 주식에 대한 Hawkes 어텐션의 출력이 상기 단순 그래프 기반 랭킹 모델 및 상기 하이퍼그래프 기반 랭킹 모델의 노드 특징 벡터로 사용될 수 있다.The step of extracting the above temporal features applies an LSTM layer and a Hawkes attention mechanism to the above time series features, and the output of the Hawkes attention for each stock can be used as a node feature vector of the simple graph-based ranking model and the hypergraph-based ranking model.

상기 시간적 특징을 추출하는 단계는, 상기 시계열 특징에 제1 양방향 LSTM 계층, Hawkes 어텐션 메커니즘, 및 제2 양방향 LSTM 계층을 적용하고, 상기 제2 양방향 LSTM 계층의 출력이 상기 분류 모델 및 상기 회귀 모델의 입력 특징 벡터로 사용될 수 있다.The step of extracting the temporal features includes applying a first bidirectional LSTM layer, a Hawkes attention mechanism, and a second bidirectional LSTM layer to the time series features, and the output of the second bidirectional LSTM layer can be used as an input feature vector of the classification model and the regression model.

상기 단순 그래프 기반 랭킹 모델은, 노드 레벨에서 그래프 어텐션 네트워크(GAT)를 사용하여 각 관계 유형에 대해서 이웃 노드들에 가중치를 할당하여 관계형 특징 벡터를 획득하고, 관계 유형 레벨에서 각 관계 유형에 대해서 어텐션 계수를 계산하고, 상기 어텐션 계수로 가중치된 상기 관계형 특징 벡터를 집계하여 최종 관계형 특징 벡터를 획득하고, 상기 최종 관계형 특징 벡터로부터 활성화 함수를 통해 랭킹 스코어를 예측할 수 있다.The above simple graph-based ranking model can obtain a relational feature vector by assigning weights to neighboring nodes for each relationship type using a graph attention network (GAT) at the node level, calculate an attention coefficient for each relationship type at the relationship type level, aggregate the relational feature vectors weighted by the attention coefficients to obtain a final relational feature vector, and predict a ranking score from the final relational feature vector through an activation function.

상기 하이퍼그래프 기반 랭킹 모델은, 입력 특징 행렬로부터 멀티-헤드 어텐션 메커니즘이 적용된 하이퍼그래프 컨볼루션 계층 및 활성화 함수를 통해 랭킹 스코어를 예측할 수 있다.The above hypergraph-based ranking model can predict ranking scores from an input feature matrix through a hypergraph convolution layer and an activation function to which a multi-head attention mechanism is applied.

상기 기술적 과제를 해결하기 위한 본 발명에 따른 주식 투자 포트폴리오 결정 장치는, 프로세서 및 상기 프로세서에 의해 실행되는 프로그램을 저장하는 메모리를 포함하고, 상기 프로세서는, 주식 데이터로부터, 단순 그래프 기반 랭킹 모델 및 하이퍼그래프 기반 랭킹 모델을 통해 각각 복수의 주식들에 대한 랭킹을 예측하고, 상기 주식 데이터로부터, 분류 모델을 통해 상기 복수의 주식들 각각에 대한 상승 확률을 예측하고, 회귀 모델을 통해 상기 복수의 주식들 각각에 대한 수익률을 예측하고, 상기 단순 그래프 기반 랭킹 모델을 통해 예측된 랭킹과 상기 하이퍼그래프 기반 랭킹 모델을 통해 예측된 랭킹을 이용하여 주식들을 선택하고, 상기 선택된 주식들에 대한 상기 예측된 상승 확률과 상기 예측된 수익률을 이용하여, 상기 선택된 주식들에 대한 투자 비율을 결정하는 것을 특징으로 한다.In order to solve the above technical problem, a stock investment portfolio determination device according to the present invention comprises a processor and a memory storing a program executed by the processor, wherein the processor predicts rankings for a plurality of stocks from stock data through a simple graph-based ranking model and a hypergraph-based ranking model, predicts an increase probability for each of the plurality of stocks through a classification model from the stock data, predicts a return rate for each of the plurality of stocks through a regression model, selects stocks using the ranking predicted through the simple graph-based ranking model and the ranking predicted through the hypergraph-based ranking model, and determines an investment ratio for the selected stocks using the predicted increase probability and the predicted return rate for the selected stocks.

상기 프로세서는, 상기 단순 그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식과 상기 하이퍼그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식으로부터 주식들을 선택할 수 있다.The above processor can select stocks from a top predetermined number of stocks predicted through the simple graph-based ranking model and a top predetermined number of stocks predicted through the hypergraph-based ranking model.

상기 프로세서는, 상기 주식 데이터를 전처리하되, 상기 주식 데이터로부터 캔들스틱 구성요소와 기술적 지표를 포함하는 특징들을 계산하고, 상기 특징들을 클러스터링하고, 클러스터 내의 특징들의 수가 소정 임계값보다 큰 각 클러스터 내의 특징들을 선택하고, 상기 선택된 특징들을 병합할 수 있다.The above processor may preprocess the stock data, calculate features including candlestick components and technical indicators from the stock data, cluster the features, select features within each cluster in which the number of features within the cluster is greater than a predetermined threshold, and merge the selected features.

상기 프로세서는, 상기 주식 데이터로부터 추출된 특징으로 구성되는 시계열 특징으로부터 LSTM(Long Short-Term Memory) 기반 시간적 모델을 통해 시간적 특징을 추출하고, 상기 프로세서는, 상기 시간적 특징으로부터 상기 랭킹, 상기 상승 확률, 및 상기 수익률을 예측할 수 있다.The processor extracts temporal features from time series features composed of features extracted from the stock data through a LSTM (Long Short-Term Memory)-based temporal model, and the processor can predict the ranking, the increase probability, and the return rate from the temporal features.

상기 단순 그래프 기반 랭킹 모델은, 노드 레벨에서 그래프 어텐션 네트워크(GAT)를 사용하여 각 관계 유형에 대해서 이웃 노드들에 가중치를 할당하여 관계형 특징 벡터를 획득하고, 관계 유형 레벨에서 각 관계 유형에 대해서 어텐션 계수를 계산하고, 상기 어텐션 계수로 가중치된 상기 관계형 특징 벡터를 집계하여 최종 관계형 특징 벡터를 획득하고, 상기 최종 관계형 특징 벡터로부터 활성화 함수를 통해 랭킹 스코어를 예측할 수 있다.The above simple graph-based ranking model can obtain a relational feature vector by assigning weights to neighboring nodes for each relationship type using a graph attention network (GAT) at the node level, calculate an attention coefficient for each relationship type at the relationship type level, aggregate the relational feature vectors weighted by the attention coefficients to obtain a final relational feature vector, and predict a ranking score from the final relational feature vector through an activation function.

상기 하이퍼그래프 기반 랭킹 모델은, 입력 특징 행렬로부터 멀티-헤드 어텐션 메커니즘이 적용된 하이퍼그래프 컨볼루션 계층 및 활성화 함수를 통해 랭킹 스코어를 예측할 수 있다.The above hypergraph-based ranking model can predict ranking scores from an input feature matrix through a hypergraph convolution layer and an activation function to which a multi-head attention mechanism is applied.

상기된 본 발명에 의하면, 딥 러닝 기반으로 주식 선정 뿐만 아니라 선정된 주식에 대한 투자 비율도 결정할 수 있다.According to the present invention described above, not only stock selection but also the investment ratio for the selected stock can be determined based on deep learning.

또한, 단순 그래프 기반 랭킹 모델과 하이퍼그래프 기반 랭킹 모델이 서로를 보완하여 수익성이 높은 종목을 효과적으로 선택할 수 있다.In addition, the simple graph-based ranking model and the hypergraph-based ranking model can complement each other to effectively select highly profitable stocks.

또한, 분류 모델을 통한 상승 확률과 회귀 모델을 통한 예측 수익률을 결합하여 효과적인 종목 배분을 달성할 수 있다. In addition, effective stock allocation can be achieved by combining the upward probability through the classification model and the predicted return through the regression model.

본 발명의 효과는 이상에서 언급한 효과로 제한되지 않으며, 언급되지 않은 또 다른 효과들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.The effects of the present invention are not limited to the effects mentioned above, and other effects not mentioned will be clearly understood by those skilled in the art from the description below.

도 1은 본 발명의 실시예에 따른 주식 투자 포트폴리오 결정 방법 및 장치의 개요를 나타내는 도면이다.
도 2는 본 발명의 일 실시예에 따른 주식 투자 포트폴리오 결정 방법의 흐름도를 나타낸다.
도 3은 본 발명의 실시예에 따른 주식 투자 포트폴리오 결정 방법을 알고리즘으로 표현한 수도 코드를 나타낸다.
도 4는 본 발명의 실시예에 따른 주식 투자 포트폴리오 결정 방법 및 장치의 전체적인 구조 및 동작을 나타내는 도면이다.
도 5는 본 발명의 일 실시예에 따른 데이터 전처리 과정을 나타내는 도면이다.
도 6은 주식 데이터로부터 생성되는 특징 및 경제 데이터의 예를 나타낸다.
도 7은 노드 특징 선택 과정의 구체적인 예를 나타낸다.
도 8은 노드 특징 선택 결과의 예를 나타낸다.
도 9는 Hawkes 어텐션 메커니즘을 나타내는 도면이다.
도 10은 관계 유형의 예를 나타낸다.
도 11은 단순 그래프 기반 랭킹 모델의 구체적인 예를 나타낸다.
도 12는 하이퍼그래프 기반 랭킹 모델의 구체적인 예를 나타낸다.
도 13은 본 발명의 일 실시예에 따른 주식 투자 포트폴리오 결정 장치의 블록도를 나타낸다.
FIG. 1 is a drawing showing an outline of a method and device for determining a stock investment portfolio according to an embodiment of the present invention.
Figure 2 illustrates a flow chart of a method for determining a stock investment portfolio according to one embodiment of the present invention.
Figure 3 shows a pseudo code that expresses a method for determining a stock investment portfolio according to an embodiment of the present invention as an algorithm.
FIG. 4 is a drawing showing the overall structure and operation of a stock investment portfolio determination method and device according to an embodiment of the present invention.
FIG. 5 is a diagram showing a data preprocessing process according to one embodiment of the present invention.
Figure 6 shows examples of features and economic data generated from stock data.
Figure 7 shows a specific example of the node feature selection process.
Figure 8 shows an example of node feature selection results.
Figure 9 is a diagram showing the Hawkes attention mechanism.
Figure 10 shows an example of a relationship type.
Figure 11 shows a specific example of a simple graph-based ranking model.
Figure 12 shows a specific example of a hypergraph-based ranking model.
FIG. 13 shows a block diagram of a stock investment portfolio determination device according to one embodiment of the present invention.

이하에서는 도면을 참조하여 본 발명의 바람직한 실시예들을 상세히 설명한다. 이하 설명 및 첨부된 도면들에서 실질적으로 동일한 구성요소들은 각각 동일한 부호들로 나타냄으로써 중복 설명을 생략하기로 한다. 또한 본 발명을 설명함에 있어 관련된 공지기능 혹은 구성에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우 그에 대한 상세한 설명은 생략하기로 한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings. In the following description and the attached drawings, substantially identical components are represented by the same reference numerals, thereby omitting redundant descriptions. In addition, when describing the present invention, if it is judged that a specific description of a related known function or configuration may unnecessarily obscure the gist of the present invention, a detailed description thereof will be omitted.

랭킹 기반 주식 선택 방법에서, 주식 간의 쌍별 관계를 나타내기 위해 단순 그래프(simple graph)를 사용하거나, 주식 간의 집합적 관계를 나타내기 위해 하이퍼그래프(hypergraph)를 사용할 수 있다. 그러나, 단순 그래프만을 사용하거나, 하이퍼그래프만을 사용하는 것은, 한쪽 유형의 관계가 무시되기 때문에 정보의 손실을 초래할 수 있다.In a ranking-based stock selection method, a simple graph can be used to represent pairwise relationships between stocks, or a hypergraph can be used to represent collective relationships between stocks. However, using only a simple graph or only a hypergraph can result in information loss because one type of relationship is ignored.

이에 본 발명의 실시예에서는, 단순 그래프만을 사용하거나 하이퍼그래프만을 사용하는 방법의 단점을 해결하고, 자동으로 주식 선정 및 주식 배분을 결정할 수 있는 딥 러닝 기반의 주식 투자 포트폴리오 결정 방법 및 장치를 제공한다.Accordingly, in an embodiment of the present invention, a method and device for determining a stock investment portfolio based on deep learning are provided, which can resolve the shortcomings of methods using only a simple graph or only a hypergraph, and automatically determine stock selection and stock distribution.

도 1은 본 발명의 실시예에 따른 주식 투자 포트폴리오 결정 방법 및 장치의 개요를 나타내는 도면이다.FIG. 1 is a drawing showing an outline of a method and device for determining a stock investment portfolio according to an embodiment of the present invention.

본 발명의 실시예에서는, 랭킹, 분류(classification)(C) 및 회귀(regression)(R) 모델을 결합하여 자동으로 종목을 선택하고 배분한다. 또한 본 발명의 실시예에서는, 종목 선정을 위해 단순 그래프(simple graph)(SG) 기반 랭킹 모델과 하이퍼그래프(hypergraph)(HG) 기반 랭킹 모델을 결합한다. 주식 간의 집단적 관계를 표현할 수 없는 단순 그래프와 주식 간 쌍대 관계를 무시하는 하이퍼그래프가 서로를 보완할 수 있다. 또한 본 발명의 실시예에서는, 종목 배분을 위해, 분류 및 회귀 모델을 결합하여 투자 비율을 결정한다. 각 종목의 미래 추세를 분석하는 분류 모델과 각 종목의 미래 가격을 예측하는 회귀 모델이 서로를 보완할 수 있다.In an embodiment of the present invention, ranking, classification (C) and regression (R) models are combined to automatically select and distribute stocks. In addition, in an embodiment of the present invention, a simple graph (SG)-based ranking model and a hypergraph (HG)-based ranking model are combined for stock selection. A simple graph that cannot express a collective relationship between stocks and a hypergraph that ignores a pairwise relationship between stocks can complement each other. In addition, in an embodiment of the present invention, for stock allocation, a classification and regression model are combined to determine an investment ratio. A classification model that analyzes the future trend of each stock and a regression model that predicts the future price of each stock can complement each other.

또한 본 발명의 실시예에서는, 계층적 클러스터링, 특징 선택 및 차원 축소 등을 사용하여 강력한 특징을 추출한다. 또한 본 발명의 실시예에서는, LSTM(Long Short-Term Memory), 양방향 LSTM(bidirectional LSTM) 및 Hawkes 어텐션 메커니즘 등을 사용하여 시게열 특징으로부터 시간적 정보를 추출한다.In addition, in the embodiment of the present invention, powerful features are extracted using hierarchical clustering, feature selection, and dimensionality reduction. In addition, in the embodiment of the present invention, temporal information is extracted from time sequence features using Long Short-Term Memory (LSTM), bidirectional LSTM, and Hawkes attention mechanism.

도 2는 본 발명의 일 실시예에 따른 주식 투자 포트폴리오 결정 방법의 흐름도를 나타낸다.Figure 2 illustrates a flow chart of a method for determining a stock investment portfolio according to one embodiment of the present invention.

S10 단계에서, 주식 데이터를 전처리하여 특징을 추출한다.In step S10, stock data is preprocessed to extract features.

S20 단계에서, 추출된 특징으로 구성되는 시계열 특징으로부터 LSTM 기반 시간적 모델을 통해 시간적 특징을 추출한다.At step S20, temporal features are extracted from the time series features composed of extracted features through an LSTM-based temporal model.

S30 단계에서, 시간적 특징으로부터 단순 그래프 기반 랭킹 모델을 통해 복수의 주식들에 대한 랭킹을 예측한다.At step S30, the rankings for multiple stocks are predicted using a simple graph-based ranking model from temporal features.

S40 단계에서, 시간적 특징으로부터 하이퍼그래프 기반 랭킹 모델을 통해 복수의 주식들에 대한 랭킹을 예측한다.At step S40, the ranking of multiple stocks is predicted using a hypergraph-based ranking model from temporal features.

S50 단계에서, 시간적 특징으로부터 분류 모델을 통해 복수의 주식들 각각에 대한 상승(uptrend) 확률을 예측한다.At step S50, the uptrend probability for each of multiple stocks is predicted using a classification model from temporal features.

S60 단계에서, 시간적 특징으로부터 회귀 모델을 통해 복수의 주식들 각각에 대한 수익률을 예측한다.At step S60, the return for each of multiple stocks is predicted using a regression model from temporal features.

S70 단계에서, 단순 그래프 기반 랭킹 모델을 통해 예측된 랭킹과 하이퍼그래프 기반 랭킹 모델을 통해 예측된 랭킹을 이용하여 주식들을 선택한다.At step S70, stocks are selected using the predicted ranking through the simple graph-based ranking model and the predicted ranking through the hypergraph-based ranking model.

S80 단계에서, 선택된 주식들에 대한 예측된 상승 확률과 예측된 수익률을 이용하여, 선택된 주식들에 대한 투자 비율을 결정한다.At step S80, the investment ratio for the selected stocks is determined using the predicted increase probability and predicted return for the selected stocks.

이하에서는 본 발명의 실시예에 따른 주식 투자 포트폴리오 결정 방법 및 장치에 관하여 보다 구체적으로 설명한다.Hereinafter, a method and device for determining a stock investment portfolio according to an embodiment of the present invention will be described in more detail.

단순 그래프 G s G s =(V, E)로 정의되고, 여기서, V는 노드들의 집합이고 E는 에지들의 집합이다. G s 내의 노드들 간의 쌍 관계를 표현하기 위해 정사각 인접 행렬(square adjacency matrix)이 사용된다. 하이퍼그래프 G h 는 노드들 간의 집단적 관계를 나타낼 수 있는 일반화된 그래프이다. 하이퍼그래프 G h G h =(V, E)로 정의되고, 여기서 V는 노드들의 집합이고 E는 하이퍼에지들의 집합이다. 각 하이퍼에지는 전체 노드 집합 간의 관계 인스턴스를 정의한다. 노드들을 하이퍼에지에 연결하기 위해 N×M 근접행렬(Incidence Matrix) H가 사용되고, 여기서 N은 노드의 수이고, M은 하이퍼에지의 수이다. 하이퍼에지 H(p,q)의 값은 q(p∈q) 내에 노드 p가 있으면 1이고, 그렇지 않으면 0이다. 2개의 대각 차수 행렬(diagonal degree matrix)은 인접 행렬로부터 정의될 수 있다. N×N 노드 차수 행렬 D v 는 각 노드가 속한 하이퍼에지의 수를 나타내고, M×M 하이퍼에지 차수 행렬 D e 는 각 하이퍼에지 내의 노드 수를 나타낸다.A simple graph G s is defined as G s = (V, E) , where V is a set of nodes and E is a set of edges. A square adjacency matrix is used to represent the pairwise relationships between nodes in G s . A hypergraph G h is a generalized graph that can represent collective relationships between nodes. A hypergraph G h is defined as G h = (V, E) , where V is a set of nodes and E is a set of hyperedges. Each hyperedge defines a relationship instance between the entire set of nodes. An N × M incidence matrix H is used to connect nodes to hyperedges, where N is the number of nodes and M is the number of hyperedges. The value of a hyperedge H(p,q) is 1 if there is a node p in q(p∈q) , and 0 otherwise. Two diagonal degree matrices can be defined from the adjacency matrices. The N×N node degree matrix D v represents the number of hyperedges to which each node belongs, and the M×M hyperedge degree matrix D e represents the number of nodes within each hyperedge.

GNN(Graph Neural Network)은 단순 그래프 또는 하이퍼그래프 내의 노드들 간의 관계를 사용하여 노드 표현을 학습한다. GNN의 동작 절차는 집계(AGGREGATE)와 업데이트(UPDATE)의 두 가지 프로세스로 나눌 수 있다. AGGREGATE 함수는, 학습 가능하며, 수학식 1과 같이 각 노드 p의 이웃 노드들로부터 정보를 반복적으로 집계하고 이웃 노드들의 집합 N(p)에 대한 표현 를 생성한다. UPDATE 함수는, 역시 학습 가능하며, 수학식 2와 같이 i-1 번째 반복에서의 를 결합하여 노드 p의 표현 를 생성한다.A GNN (Graph Neural Network) learns node representations using relationships between nodes in a simple graph or hypergraph. The operation procedure of a GNN can be divided into two processes: AGGREGATE and UPDATE. The AGGREGATE function is learnable and repeatedly aggregates information from the neighboring nodes of each node p as shown in Equation 1 and provides a representation for the set of neighboring nodes N(p). The UPDATE function is also learnable, and in the i-1th iteration, as in Equation 2, and Representation of node p by combining Creates .

GNN의 발전과 함께, GCN(graph convolutional network), GAT(graph attention network)와 같은 향상된 네트워크가 제안되었다. GCN은 지역적 연결 패턴을 포착하기 위해 합성곱 신경망을 사용하고, GAT는 이웃 노드의 중요도에 따라 다른 가중치를 할당하기 위하여 셀프 어텐션(self attention) 메커니즘을 사용한다.With the development of GNN, improved networks such as GCN(graph convolutional network) and GAT(graph attention network) have been proposed. GCN uses convolutional neural network to capture local connectivity patterns, and GAT uses self-attention mechanism to assign different weights according to the importance of neighboring nodes.

GAT는 노드 p의 이웃 노드들(그리고 p 자체)의 상대적 중요도를 포착하기 위해 어텐션 메커니즘을 사용하여 다른 가중치를 할당한다. GAT에서, GNN에서의 AGGREGATE 및 UPDATE 함수는 분리되지 않는다. GAT는 수학식 3과 같이 노드 p와 q 간의 어텐션 계수 를 계산한다. 여기서, 은 각각 i-1 번째 반복에서 노드 p와 q의 표현을 나타내고, a 및 W는 학습 가능한 파라미터이며, 은 LeakyReLU와 같은 비선형 함수이며, 는 연결(concatenation) 연산을 나타낸다. 어텐션 계수 는 단순 그래프에서 p에 대한 q의 중요도를 나타낸다.GAT uses an attention mechanism to assign different weights to capture the relative importance of the neighboring nodes of node p (and p itself). In GAT, the AGGREGATE and UPDATE functions in GNN are not separated. GAT calculates the attention coefficient between nodes p and q as shown in Equation 3. Calculate . Here, and represents the representation of nodes p and q at the i-1th iteration, respectively, and a and W are learnable parameters. is a nonlinear function like LeakyReLU, represents the concatenation operation. Attention coefficient represents the importance of q with respect to p in a simple graph.

어텐션 계수를 기반으로, GAT는, 수학식 4와 같이 자신을 포함하는 이웃 노드들 N(p)의 가중치 합으로 노드 p의 새로운 표현 를 획득한다. 여기서, 는 수학식 3에 따른 어텐션 계수이고, 는 시그모이드 또는 소프트맥스와 같은 비선형 함수이다.Based on the attention coefficient, GAT provides a new representation of node p as the weighted sum of its neighboring nodes N(p) including itself, as in Equation 4. , get . Here, is the attention coefficient according to mathematical formula 3, is a nonlinear function such as sigmoid or softmax.

학습 과정을 안정화하기 위해, GAT는 수학식 5와 같은 멀티 헤드 어텐션 메커니즘을 사용한다. 여기서 K는 헤드의 수이다.To stabilize the learning process, GAT uses a multi-head attention mechanism as shown in Equation 5, where K is the number of heads.

도 3은 본 발명의 실시예에 따른 주식 투자 포트폴리오 결정 방법을 알고리즘으로 표현한 수도 코드를 나타낸다.Figure 3 shows a pseudo code that expresses a method for determining a stock investment portfolio according to an embodiment of the present invention as an algorithm.

제2행을 참조하면, 단순 그래프 기반 랭킹 모델(SG)을 통해 획득된 top-K(즉, 상위 소정 개수) 주식과 하이퍼그래프 기반 랭킹 모델을 통해 획득된 top-K 주식을 교집합하여 이익 창출이 기대되는 주식들을 선택한다.Referring to the second row, the top-K (i.e., a certain number of top) stocks obtained through a simple graph-based ranking model (SG) and the top-K stocks obtained through a hypergraph-based ranking model are intersected to select stocks expected to generate profits.

제3 내지 제6행을 참조하면, 주식 배분을 위해, 분류 모델(C) 및 회귀 모델(R)을 각각 사용하여, 선택된 각 주식에 대하여 상승 확률 및 수익률을 예측하고, 예측된 상승 확률 및 수익률을 각각 가중치 벡터 WC 및 WR에 저장한다.Referring to rows 3 to 6, for stock allocation, the classification model (C) and the regression model (R) are used respectively to predict the probability of increase and the return for each selected stock, and the predicted probability of increase and the return are stored in the weight vectors W C and W R , respectively.

제7행을 참조하면, 가중치 벡터 WC 및 WR을 소프트맥스 함수를 사용하여 정규화한다.Referring to row 7, the weight vectors W C and W R are normalized using the softmax function.

제8행을 참조하면, COMBINE 함수를 사용하여 가중치 벡터 WC 및 WR을 결합하여 투자 비율 벡터 Wratio를 계산한다. 여기서, COMBINE 함수로는 예컨대 요소별 곱셈(element-wise multiplication)()이 사용될 수 있다.Referring to line 8, the COMBINE function is used to combine the weight vectors W C and W R to calculate the investment ratio vector W ratio . Here, the COMBINE function can be used for, for example, element-wise multiplication ( ) can be used.

제9행 및 제10행을 참조하면, Wratio를 투자 비율들의 합이 1이 되도록 정규화하고, 선택된 주식들과 해당 투자 비율들을 반환한다.Referring to rows 9 and 10, W ratio is normalized so that the sum of the investment ratios becomes 1, and the selected stocks and their corresponding investment ratios are returned.

실시예에 따라서, 랭킹 모델, 분류 모델, 회귀 모델은 앙상블 기법을 사용하여 여러 모델로 확장될 수 있다. 또한 실시예에 따라서, 제2행에서 주식 선택을 위하여 교집합 대신에 다른 함수가 사용될 수 있다. 또한 실시예에 따라서, 제8행에서 가중치 벡터 WC 및 WR의 결합을 위한 COMBINE 함수로 요소별 곱셈 대신에 다른 함수가 사용될 수 있다.According to an embodiment, the ranking model, the classification model, and the regression model can be extended to multiple models using ensemble techniques. Also according to an embodiment, another function can be used instead of the intersection for stock selection in the second row. Also according to an embodiment, another function can be used instead of the element-wise multiplication as the COMBINE function for combining the weight vectors W C and W R in the eighth row.

도 4는 본 발명의 실시예에 따른 주식 투자 포트폴리오 결정 방법 및 장치의 전체적인 구조 및 동작을 나타내는 도면이다.FIG. 4 is a drawing showing the overall structure and operation of a stock investment portfolio determination method and device according to an embodiment of the present invention.

본 발명의 실시예에 의하면, 주식 데이터 및 경제 데이터를 전처리하고, 시간적 모델을 이용하여 역사적 데이터의 종속성을 포착하고, 관계형 모델링을 적용한 랭킹 모델을 이용하여 주식을 선택하고, 분류 및 회귀 모델을 이용하여 선택된 주식들을 분배한다. 시간적 모델은 불안정한 학습 및 과적합을 방지하기 위해 얕은(shallow) 네트워크를 사용할 수 있다. 이하에서는 도 4의 각 요소에 관하여 보다 구체적으로 설명한다. According to an embodiment of the present invention, stock data and economic data are preprocessed, the dependency of historical data is captured using a temporal model, stocks are selected using a ranking model that applies relational modeling, and the selected stocks are distributed using classification and regression models. The temporal model can use a shallow network to prevent unstable learning and overfitting. Each element of Fig. 4 is described in more detail below.

데이터 전처리Data preprocessing

데이터 전처리 과정에서, 원자재, 채권, 통화, 및 시장 지수와 더불어 각 주식의 캔들스틱 구성요소와 기술적 지표로부터 특징을 추출할 수 있다. 도 5는 본 발명의 일 실시예에 따른 데이터 전처리 과정을 나타내는 도면이다.In the data preprocessing process, features can be extracted from candlestick components and technical indicators of each stock, as well as raw materials, bonds, currencies, and market indices. Fig. 5 is a diagram illustrating a data preprocessing process according to one embodiment of the present invention.

시가, 고가, 저가, 종가, 및 거래량으로 구성되는 주식 데이터를 이용하여 캔들스틱 구성요소 및 기술적 지표를 계산할 수 있다. 도 6은 캔들스틱 구성요소, 기술적 지표, 및 경제 데이터 등 입력 특징들의 예를 나타낸다.Candlestick components and technical indicators can be calculated using stock data consisting of opening price, high price, low price, closing price, and trading volume. Figure 6 shows examples of input features such as candlestick components, technical indicators, and economic data.

그 다음, 중앙값과 사분범위를 이용하여 이상점(outlier)의 영향을 최소화하는 정규화 기법을 이용하여 입력 특징들을 정규화할 수 있다.Next, the input features can be normalized using a normalization technique that minimizes the influence of outliers by using the median and interquartile range.

그 다음, 집적 계층적 클러스터링을 사용하여 특징들을 클러스터링하여 피어슨 상관 계수(Pearson's correlation coefficient) 측면에서 유사한 특징들을 분류할 수 있다.Next, we can use aggregated hierarchical clustering to cluster the features so that similar features can be classified in terms of Pearson's correlation coefficient.

클러스터링 후에, 클러스터 내의 특징들의 수가 소정 임계값 F보다 큰 각 클러스터에 대하여, 해당 클러스터 내의 특징들을 선택할 수 있다.After clustering, for each cluster where the number of features in the cluster is greater than a predetermined threshold F, the features in that cluster can be selected.

그리고 각 클러스터에 대하여 선택된 특징들을 병합할 수 있다. 병합된 특징들은 각 주식의 분류 및 회귀 모델 뿐만 아니라 각 주식마다 상이할 수 있다(도 8 참조).And the selected features for each cluster can be merged. The merged features can be different for each stock as well as the classification and regression models for each stock (see Figure 8).

선택된 특징들을 병합한 후, 노이즈 제거를 위해, 희소 주성분 분석(sparse principal component analysis)을 사용하여 병합된 특징들의 차원을 축소할 수 있다. 차원이 축소된 특징들은 분류 및 회귀 모델을 위한 시간적 모델에 제공될 수 있다.After merging the selected features, the dimension of the merged features can be reduced using sparse principal component analysis to remove noise. The reduced-dimension features can be provided to the temporal model for classification and regression models.

랭킹 모델의 경우, 단순 그래프와 하이퍼그래프의 각 노드에 동일 특징 집합이 제공될 필요가 있다. 도 7은 노드 특징 선택 과정의 구체적인 예를 나타낸다.For the ranking model, each node of the simple graph and hypergraph needs to be provided with the same feature set. Figure 7 shows a specific example of the node feature selection process.

각 노드(주식)를 위한 공통 특징을 획득하기 위해, 주식 i의 분류 모델 Ci 및 회귀 모델 Ri에 대하여 각각 병합된 특징들 를 획득할 수 있다. 그리고 각 주식에 대하여 를 교집합하여 공통 특징을 획득할 수 있다. 그 다음 모든 주식들의 공통 특징을 결합하고 빈도가 높은 top-K 특징들을 선택하여, 동일 특징 집합을 획득할 수 있다. 도 8은 노드 특징 선택 결과의 예를 나타낸다. 도 8을 참조하면, 각 주식에 대하여, 병합된 특징들 의 교집합인 공통 특징은 각각 (시가, 고가), (시가), 및 (시가, 고가, AD)이다. 모든 주식들의 공통 특징들을 결합하고 빈도가 높은 top-2 특징을 선택하면, (시가, 고가)가 된다. To obtain common features for each node (stock), the merged features are respectively for the classification model Ci and the regression model Ri of stock i. and can be obtained. And for each stock and By combining the common features of all stocks and selecting the top-K features with high frequency, a set of identical features can be obtained. Figure 8 shows an example of the result of node feature selection. Referring to Figure 8, for each stock, the merged features and The common features, which are the intersection of , are (open, high), (open), and (open, high, AD). Combining the common features of all stocks and selecting the top-2 features with high frequency results in (open, high).

선택된 특징들은 단순 그래프 기반 랭킹 모델 및 하이퍼그래프 기반 랭킹 모델을 위한 시간적 모델에 제공될 수 있다.The selected features can be provided to temporal models for simple graph-based ranking models and hypergraph-based ranking models.

시간적 모델Temporal model

시간적 모델의 입력은 전처리된 특징 벡터의 슬라이딩 윈도우일 수 있다. 시간적 모델은, 도 4에 도시된 바와 같이 주식 선택을 위한 랭킹 모델과 주식 분배를 위한 분류 및 회귀 모델에 대하여 서로 다를 수 있다. 랭킹 모델을 위해, LSTM 계층과 Hawkes 어텐션 메커니즘이 적용되고, 각 주식에 대한 Hawkes 어텐션의 출력이 랭킹 모델의 노드 특징 벡터로 사용될 수 있다. 분류 및 회귀 모델을 위해, 도 4에 도시된 바와 같이 첫 번째 양방향 LSTM 계층, Hawkes 어텐션 메커니즘, 및 두 번째 양방향 LSTM 계층을 적용하고, 두 번째 양방향 LSTM 계층의 출력이 분류 및 회귀 모델의 입력 특징 벡터로 사용될 수 있다.The input of the temporal model can be a sliding window of the preprocessed feature vector. The temporal models can be different for the ranking model for stock selection and the classification and regression model for stock distribution, as illustrated in Fig. 4. For the ranking model, the LSTM layer and the Hawkes attention mechanism are applied, and the output of the Hawkes attention for each stock can be used as the node feature vector of the ranking model. For the classification and regression model, the first bidirectional LSTM layer, the Hawkes attention mechanism, and the second bidirectional LSTM layer are applied, as illustrated in Fig. 4, and the output of the second bidirectional LSTM layer can be used as the input feature vector of the classification and regression model.

도 9는 Hawkes 어텐션 메커니즘을 나타내는 도면이다. Hawkes 프로세스는 미래에 대한 이벤트의 시간 소멸성 영향을 모델링하는 자기 흥분(self-exciting) 시간적 포인트 프로세스(temporal point process)이다. Hawkes 어텐션 메커니즘은 어텐션 메커니즘과 Hawkes 프로세스를 결합하여 미래 가격에 영향을 미치는 중요한 날짜에 더 높은 가중치를 부여하고 주식 및 경제 데이터에서 자기 흥분 현상을 포착할 수 있다.Figure 9 is a diagram showing the Hawkes attention mechanism. The Hawkes process is a self-exciting temporal point process that models the temporal decay of events in the future. The Hawkes attention mechanism combines the attention mechanism and the Hawkes process to give higher weight to important dates that affect future prices, and can capture self-excitation phenomena in stock and economic data.

Hawkes 어텐션 메커니즘은 먼저 수학식 6과 같이 표현되는 각 시간 스텝 τ(<T)에 대하여, 일일 잠재 표현 를 계산한다. 여기서 는 학습 가능한 어텐션 가중치이고, 는 히든 스테이트(hidden state)이며, 는 마지막 히든 스테이트이다.The Hawkes attention mechanism first computes a daily latent representation for each time step τ(<T), which is expressed as in Equation 6. Calculate . Here is a learnable attention weight, is a hidden state, is the last hidden state.

그런 다음, 수학식 7과 같이 이전 T-1 시간 스텝의 에 Hawkes 프로세스를 적용하여 벡터 을 계산한다. 여기서 ε 및 γ는 각각 학습 가능한 여기 및 감쇠 파라미터이고, 는 현재 T와 과거 시간 스텝 τ 사이의 시간 간격이다.Then, as in Equation 7, the previous T-1 time step Applying Hawkes process to vector where ε and γ are learnable excitation and damping parameters, respectively, is the time interval between the current T and the past time step τ.

Hawkes 프로세스 적용 후, hT와 vT-1을 결합한 다음, tanh 활성화 함수를 가지는 선형 레이어를 통해 t 일의 시간적 특징 벡터 를 획득한다.After applying the Hawkes process, h T and v T-1 are combined, and then the temporal feature vector of day t is processed through a linear layer with a tanh activation function. Obtain .

단순 그래프 기반 랭킹 모델Simple graph-based ranking model

단순 그래프의 구성을 위해, 섹터, 1차, 및 2차 기업 관계 유형의 세 가지 유형의 관계가 사용될 수 있다. 섹터는 유사한 특징을 가지는 산업의 집단을 말한다. 예를 들어, IT 섹터는 서비스, 소프트웨어, 및 통신 장비와 같은 산업으로 구성된다. 글로벌 산업 분류 표준 및 위키데이터 등로부터 섹터-산업 및 기업 관계가 수집될 수 있다. 섹터 관계 유형은 동일 섹터 내에 있는 두 주식 간의 관계 인스턴스를 나타낸다. 1차 관계 유형 R1은 R1을 통해 연결된 두 주식 간의 관계 인스턴스를 나타낸다. 2차 관계 유형 R2R3는 엔티티 관계 R2 및 R3(즉, )를 통해 두 주식 A와 B를 연결하는 엔티티 E를 통한 간접적 관계 인스턴스를 나타낸다. 각 관계 인스턴스는 그래프 내에서 양방향 에지로 생성된다. 도 10은 다양한 관계 유형들의 예를 나타낸다. 다만 그래프는 뉴스, 동적 시간 워핑(dynamic time warping) 등 다른 데이터 소스들을 이용하여 구성될 수도 있다.For the construction of a simple graph, three types of relationships can be used: sector, first-order, and second-order firm relationship types. A sector refers to a group of industries with similar characteristics. For example, the IT sector consists of industries such as services, software, and communication equipment. Sector-industry and firm relationships can be collected from the Global Industry Classification Standard and Wikidata, etc. The sector relationship type represents a relationship instance between two stocks within the same sector. The first-order relationship type R 1 represents a relationship instance between two stocks connected through R 1 . The second-order relationship type R 2 R 3 represents entity relationships R2 and R3 (i.e., ) represents an indirect relationship instance through entity E that connects two stocks A and B. Each relationship instance is created as a bidirectional edge within the graph. Figure 10 shows examples of various relationship types. However, the graph can also be constructed using other data sources such as news, dynamic time warping, etc.

도 11은 단순 그래프 기반 랭킹 모델의 구체적인 예를 나타낸다. 본 발명의 실시예에 따른 단순 그래프 기반 랭킹 모델은 노드 및 관계 유형 레벨에서 어텐션 메커니즘을 계층적으로 적용하여 다른 관계 유형의 상대적 중요도 뿐만 아니라 이웃 노드들의 상대적 중요도를 포착할 수 있다. 노드 레벨에서, 그래프 어텐션 네트워크(GAT)를 사용하여 각 관계 유형 ri에 대해서 이웃 노드들에 가중치를 할당하여 관계형 특징 벡터 을 획득할 수 있다. 관계 유형 레벨에서, 각 관계 유형 ri에 대해서 수학식 9와 같이 표현되는 어텐션 계수 를 계산할 수 있다. 여기서 W 및 b는 학습 가능한 파라미터이고 m은 관계 유형의 수이다.Fig. 11 shows a specific example of a simple graph-based ranking model. The simple graph-based ranking model according to an embodiment of the present invention can capture the relative importance of neighboring nodes as well as the relative importance of different relationship types by hierarchically applying the attention mechanism at the node and relationship type levels. At the node level, a graph attention network (GAT) is used to assign weights to neighboring nodes for each relationship type r i to generate a relational feature vector. can be obtained. At the relationship type level, for each relationship type r i , the attention coefficient is expressed as in mathematical expression 9. can be calculated, where W and b are learnable parameters and m is the number of relationship types.

어텐션 계수를 계산한 후에, 수학식 10과 같이, 어텐션 계수로 가중치된 를 집계하여 최종 관계형 특징 벡터 vr을 획득할 수 있다. 그런 다음, LeakyReLU 활성화 함수를 가지는 선형 레이어를 통해 랭킹 스코어를 예측할 수 있다.After calculating the attention coefficient, weighted by the attention coefficient as in Equation 10, By aggregating, the final relational feature vector v r can be obtained. Then, the ranking score can be predicted through a linear layer with LeakyReLU activation function.

단순 그래프 기반 모델을 최적화하기 위해, 수학식 11과 같은 손실 함수를 사용하여 학습할 수 있다. 여기서, 은 각각 예측된 랭킹 벡터 및 그라운드-트루스(ground-truth) 랭킹 벡터를 나타낸다. 그라운드-트루스 랭킹 스코어는 각 주식에 대한 일일 수익률을 이용하여 산출될 수 있다. 수학식 11의 손실 함수는 점별 회귀 손실과 쌍별 랭킹 인식 손실을 결합한 것이다. 여기서, ρ는 두 손실항의 균형을 맞추는 하이퍼파라미터이고, N은 주식의 수이다.To optimize a simple graph-based model, we can learn using a loss function such as Equation 11. Here, and represent the predicted ranking vector and the ground-truth ranking vector, respectively. The ground-truth ranking score can be calculated using the daily return for each stock. The loss function in Equation 11 combines the point-wise regression loss and the pair-wise ranking recognition loss. Here, ρ is a hyperparameter that balances the two loss terms, and N is the number of stocks.

하이퍼그래프 기반 랭킹 모델Hypergraph-based ranking model

섹터, 산업, 1차, 및 2차 관계 인스턴스를 하이퍼에지로 변환하여 하이퍼그래프를 구성할 수 있다. 섹터 및 산업 관계 인스턴스의 경우, 동일한 섹터 또는 산업에 속한 주식들의 집합이 하이퍼에지 로 변환될 수 있다. 주식 A에 대한 1차 관계 유형 R1의 경우, R1을 통해 A에 연결된 주식들의 집합이 하이퍼에지 로 변환될 수 있다. 관계 유형 R2 및 R3를 통해 엔티티 E에 연결된 주식들의 집합은 하이퍼에지 로 변환될 수 있다. 이러한 하이퍼에지들은 결합되고 중복 제거되어 를 형성할 수 있다.Sector, industry, first-order, and second-order relationship instances can be converted into hyperedges to construct a hypergraph. For sector and industry relationship instances, a set of stocks belonging to the same sector or industry is converted into a hyperedge. can be converted to . For a first-order relationship type R 1 for stock A, the set of stocks connected to A through R 1 is a hyperedge. can be converted to a hyperedge. The set of stocks connected to entity E through relationship types R 2 and R 3 These hyperedges can be combined and deduplicated. can be formed.

도 12는 하이퍼그래프 기반 랭킹 모델의 구체적인 예를 나타낸다. 하이퍼그래프로부터 관계형 특징을 추출하기 위해, 수학식 12와 같이 멀티-헤드 어텐션 메커니즘이 적용된 하이퍼그래프 컨볼루션(HConv)이 사용될 수 있다. Fig. 12 shows a specific example of a hypergraph-based ranking model. In order to extract relational features from a hypergraph, a hypergraph convolution (HConv) with a multi-head attention mechanism applied as in Equation 12 can be used.

여기서 X는 입력 특징 행렬이고, 은 어텐션 에지 가중치를 가지는 하이퍼그래프 근접 행렬(hypergraph incidence matrix)이며, Pk는 학습 가능한 파라미터 행렬이고, K는 헤드의 수이며, 는 각각 노드 및 하이퍼에지 차수 행렬이다. 하이퍼그래프 기반 랭킹 모델은 ELU 활성화 함수를 가지는 2개의 하이퍼그래프 컨볼루션(HConv) 계층과 LeakyReLU 활성화 함수를 가지는 최종 선형 레이어를 포함할 수 있다. 첫 번째 HConv 레이어에서 X는 시간적 모델을 통해 획득된 시간적 특징 행렬이다. 하이퍼그래프 기반 랭킹 모델은 상기 수학식 11과 같은 손실 함수를 사용하여 최적화될 수 있다.Here, X is the input feature matrix, is a hypergraph incidence matrix with attention edge weights, P k is a learnable parameter matrix, K is the number of heads, and are node and hyperedge degree matrices, respectively. The hypergraph-based ranking model may include two hypergraph convolution (HConv) layers with ELU activation function and a final linear layer with LeakyReLU activation function. In the first HConv layer, X is a temporal feature matrix obtained through a temporal model. The hypergraph-based ranking model may be optimized using a loss function such as the above mathematical expression 11.

수학식 12의 하이퍼그래프 어텐션 메커니즘은 노드 p(∈q)에 대한 하이퍼에지 q의 중요도를 포착한다. 어텐션 계수 는 수학식 13에 의해 계산될 수 있다. 여기서 xp 및 xq는 각각 노드 및 하이퍼에지 특징을 나타낸다.The hypergraph attention mechanism of Equation 12 captures the importance of hyperedge q for node p(∈q). The attention coefficient can be calculated by mathematical expression 13, where x p and x q represent node and hyperedge features, respectively.

하이퍼에지 특징 xq는 하이퍼에지 q에 포함된 노드들의 특징 벡터를 합산하여 생성된다. 수학식 13에서, a 및 W는 학습 가능한 파라미터이고, N(p)는 p가 속하는 하이퍼에지들의 집합이다. Hyperedge feature x q is generated by summing the feature vectors of nodes included in hyperedge q. In Equation 13, a and W are learnable parameters, and N(p) is the set of hyperedges to which p belongs.

분류 모델 및 회귀 모델Classification models and regression models

도 3의 분류 모델 및 회귀 모델은, 투자 비율을 산출하기 위해 사용된다. 분류 모델 및 회귀 모델은 시간적 모델의 출력을 입력으로 사용한다.The classification model and regression model of Fig. 3 are used to calculate the investment ratio. The classification model and regression model use the output of the temporal model as input.

각 주식에 대하여, 분류 모델은 주식과 시장 지수(예컨대 S&P 500 지수 등과 같은) 간의 상대적 추세를 예측할 수 있다. 수학식 14와 같이 주식 i의 일일 수익률 는 시장 지수의 일일 수익률 와 비교될 수 있다. 추세 예측은 이진 분류 작업으로 공식화될 수 있다. 여기서 는 t일에서의 그라운드-트루스 레이블을 나타낸다.For each stock, the classification model can predict the relative trend between the stock and a market index (such as the S&P 500 index). The daily return of stock i is as shown in Equation 14. is the daily return of the market index can be compared with. Trend prediction can be formulated as a binary classification task. Here represents the ground-truth label at day t.

시그모이드 함수를 가지는 최종 선형 레이어를 사용하여 확률 시장 지수 대비 상승 확률 가 예측될 수 있다. 손실 함수로는 예측된 확률과 그라운드-트루스 레이블 간의 바이너리 크로스-엔트로피가 사용될 수 있다. 예측된 확률이 도 3에 도시된 알고리즘의 4행의 예측 상승 확률로 사용될 수 있다.Using a final linear layer with a sigmoid function, the probability of an uptrend over the probability market index is can be predicted. The binary cross-entropy between the predicted probability and the ground-truth label can be used as the loss function. The predicted probability can be used as the predicted up-probability in row 4 of the algorithm shown in Fig. 3.

회귀 모델은 최종 선형 레이어를 이용하여 다음날의 주식 종가를 예측할 수 있다. 손실 함수로는 예측된 가격과 실제 가격 간의 평균 제곱 오차가 사용될 수 있다. 예측된 가격이 도 3에 도시된 알고리즘의 5행의 예측 수익률을 계산하는데 사용될 수 있다.The regression model can use the final linear layer to predict the closing price of the next day's stock. The loss function can be the mean square error between the predicted price and the actual price. The predicted price can be used to calculate the predicted return in row 5 of the algorithm shown in Figure 3.

본 발명의 실시예에 따른 주식 투자 포트폴리오 결정 방법은 주식 투자 포트폴리오 결정 장치에 의해 수행될 수 있다.A stock investment portfolio determination method according to an embodiment of the present invention can be performed by a stock investment portfolio determination device.

도 13은 본 발명의 일 실시예에 따른 주식 투자 포트폴리오 결정 장치의 블록도를 나타낸다.FIG. 13 shows a block diagram of a stock investment portfolio determination device according to one embodiment of the present invention.

주식 투자 포트폴리오 결정 장치(110)는 적어도 하나의 프로세서(120), 컴퓨터 판독 가능한 저장매체(130) 및 통신 버스(170)를 포함한다. A stock investment portfolio decision device (110) includes at least one processor (120), a computer-readable storage medium (130), and a communication bus (170).

프로세서(120)는 주식 투자 포트폴리오 결정 장치(110)로 동작하도록 제어할 수 있다. 예컨대, 프로세서(120)는 컴퓨터 판독 가능한 저장 매체(130)에 저장된 하나 이상의 프로그램들을 실행할 수 있다. 하나 이상의 프로그램들은 하나 이상의 컴퓨터 실행 가능 명령어를 포함할 수 있으며, 컴퓨터 실행 가능 명령어는 프로세서(120)에 의해 실행되는 경우 주식 투자 포트폴리오 결정 장치(110)로 하여금 실시예들에 따른 동작들을 수행하도록 구성될 수 있다.The processor (120) may be controlled to operate as a stock investment portfolio determination device (110). For example, the processor (120) may execute one or more programs stored in a computer-readable storage medium (130). The one or more programs may include one or more computer-executable instructions, and the computer-executable instructions, when executed by the processor (120), may be configured to cause the stock investment portfolio determination device (110) to perform operations according to the embodiments.

컴퓨터 판독 가능한 저장 매체(130)는 컴퓨터 실행 가능 명령어 내지 프로그램 코드, 프로그램 데이터 및/또는 다른 적합한 형태의 정보를 저장하도록 구성된다. 컴퓨터 실행 가능 명령어 내지 프로그램 코드, 프로그램 데이터 및/또는 다른 적합한 형태의 정보는 입출력 인터페이스(150)나 통신 인터페이스(160)를 통해서도 주어질 수 있다. 컴퓨터 판독 가능한 저장 매체(130)에 저장된 프로그램(140)은 프로세서(120)에 의해 실행 가능한 명령어의 집합을 포함한다. 일 실시예에서, 컴퓨터 판독 가능한 저장 매체(130)는 메모리(랜덤 액세스 메모리와 같은 휘발성 메모 리, 비휘발성 메모리, 또는 이들의 적절한 조합), 하나 이상의 자기 디스크 저장 디바이스들, 광학 디스크 저장 디바이스들, 플래시 메모리 디바이스들, 그 밖에 주식 투자 포트폴리오 결정 장치(110)에 의해 액세스되고 원하는 정보를 저장할 수 있는 다른 형태의 저장 매체, 또는 이들의 적합한 조합일 수 있다.The computer-readable storage medium (130) is configured to store computer-executable instructions or program code, program data, and/or other suitable forms of information. The computer-executable instructions or program code, program data, and/or other suitable forms of information may also be provided via the input/output interface (150) or the communication interface (160). The program (140) stored in the computer-readable storage medium (130) includes a set of instructions executable by the processor (120). In one embodiment, the computer-readable storage medium (130) may be a memory (volatile memory such as random access memory, nonvolatile memory, or a suitable combination thereof), one or more magnetic disk storage devices, optical disk storage devices, flash memory devices, any other form of storage medium that can be accessed by the stock investment portfolio decision device (110) and that can store desired information, or a suitable combination thereof.

통신 버스(170)는 프로세서(120), 컴퓨터 판독 가능한 저장 매체(130)를 포함하여 주식 투자 포트폴리오 결정 장치(110)의 다른 다양한 컴포넌트들을 상호 연결한다.A communication bus (170) interconnects various other components of the stock investment portfolio decision device (110), including a processor (120) and a computer-readable storage medium (130).

주식 투자 포트폴리오 결정 장치(110)는 또한 하나 이상의 입출력 장치를 위한 인터페이스를 제공하는 하나 이상의 입출력 인터페이스(150) 및 하나 이상의 통신 인터페이스(160)를 포함할 수 있다. 입출력 인터페이스(150) 및 통신 인터페이스(160)는 통신 버스(170)에 연결된다. 입출력 장치(미도시)는 입출력 인터페이스(150)를 통해 주식 투자 포트폴리오 결정 장치(110)의 다른 컴포넌트들에 연결될 수 있다.The stock investment portfolio decision device (110) may also include one or more input/output interfaces (150) providing interfaces for one or more input/output devices and one or more communication interfaces (160). The input/output interfaces (150) and the communication interfaces (160) are connected to a communication bus (170). The input/output devices (not shown) may be connected to other components of the stock investment portfolio decision device (110) via the input/output interfaces (150).

프로세서(120)는, 주식 데이터로부터, 단순 그래프 기반 랭킹 모델 및 하이퍼그래프 기반 랭킹 모델을 통해 각각 복수의 주식들에 대한 랭킹을 예측하고, 주식 데이터로부터, 분류 모델을 통해 복수의 주식들 각각에 대한 상승 확률을 예측하고, 회귀 모델을 통해 복수의 주식들 각각에 대한 수익률을 예측하고, 단순 그래프 기반 랭킹 모델을 통해 예측된 랭킹과 하이퍼그래프 기반 랭킹 모델을 통해 예측된 랭킹을 이용하여 주식들을 선택하고, 선택된 주식들에 대한 예측된 상승 확률과 예측된 수익률을 이용하여, 선택된 주식들에 대한 투자 비율을 결정한다.The processor (120) predicts rankings for a plurality of stocks, respectively, from stock data through a simple graph-based ranking model and a hypergraph-based ranking model, predicts an increase probability for each of the plurality of stocks through a classification model from the stock data, predicts a return on each of the plurality of stocks through a regression model, selects stocks using the predicted ranking through the simple graph-based ranking model and the predicted ranking through the hypergraph-based ranking model, and determines an investment ratio for the selected stocks using the predicted increase probability and the predicted return on the selected stocks.

프로세서(120)는, 단순 그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식과 하이퍼그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식으로부터 주식들을 선택할 수 있다.The processor (120) can select stocks from a predetermined number of top stocks predicted through a simple graph-based ranking model and a predetermined number of top stocks predicted through a hypergraph-based ranking model.

프로세서(120)는, 주식 데이터를 전처리하되, 주식 데이터로부터 캔들스틱 구성요소와 기술적 지표를 포함하는 특징들을 계산하고, 특징들을 클러스터링하고, 클러스터 내의 특징들의 수가 소정 임계값보다 큰 각 클러스터 내의 특징들을 선택하고, 선택된 특징들을 병합할 수 있다.The processor (120) may preprocess stock data, calculate features including candlestick components and technical indicators from the stock data, cluster the features, select features within each cluster in which the number of features within the cluster is greater than a predetermined threshold, and merge the selected features.

프로세서(120)는, 주식 데이터로부터 추출된 특징으로 구성되는 시계열 특징으로부터 LSTM(Long Short-Term Memory) 기반 시간적 모델을 통해 시간적 특징을 추출하고, 시간적 특징으로부터 랭킹, 상승 확률, 및 수익률을 예측할 수 있다.The processor (120) extracts temporal features from time series features composed of features extracted from stock data through a LSTM (Long Short-Term Memory)-based temporal model, and can predict ranking, increase probability, and rate of return from the temporal features.

주식 투자 포트폴리오 결정 장치는 하드웨어, 펌웨어, 소프트웨어 또는 이들의 조합에 의해 로직회로 내에서 구현될 수 있고, 범용 또는 특정 목적 컴퓨터를 이용하여 구현될 수도 있다. 장치는 고정배선형(Hardwired) 기기, 필드 프로그램 가능한 게이트 어레이(Field Programmable Gate Array, FPGA), 주문형 반도체(Application Specific Integrated Circuit, ASIC) 등을 이용하여 구현될 수 있다. 또한, 주식 투자 포트폴리오 결정 장치는 하나 이상의 프로세서 및 컨트롤러를 포함한 시스템온칩(System on Chip, SoC)으로 구현될 수 있다.The stock investment portfolio decision device can be implemented in a logic circuit by hardware, firmware, software, or a combination thereof, and can also be implemented using a general-purpose or special-purpose computer. The device can be implemented using a hardwired device, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), etc. In addition, the stock investment portfolio decision device can be implemented as a system on chip (SoC) including one or more processors and controllers.

주식 투자 포트폴리오 결정 장치는 하드웨어적 요소가 마련된 컴퓨팅 디바이스 또는 서버에 소프트웨어, 하드웨어, 또는 이들의 조합하는 형태로 탑재될 수 있다. 컴퓨팅 디바이스 또는 서버는 각종 기기 또는 유무선 통신망과 통신을 수행하기 위한 통신 모뎀 등의 통신장치, 프로그램을 실행하기 위한 데이터를 저장하는 메모리, 프로그램을 실행하여 연산 및 명령하기 위한 마이크로프로세서 등을 전부 또는 일부 포함한 다양한 장치를 의미할 수 있다.The stock investment portfolio decision device may be installed in a computing device or server equipped with hardware elements in the form of software, hardware, or a combination thereof. The computing device or server may mean various devices including all or part of a communication device such as a communication modem for communicating with various devices or wired/wireless communication networks, a memory for storing data for executing a program, and a microprocessor for executing a program to perform calculations and commands.

도 2에서는 각각의 과정을 순차적으로 실행하는 것으로 기재하고 있으나 이는 예시적으로 설명한 것에 불과하고, 이 분야의 기술자라면 본 발명의 실시예의 본질적인 특성에서 벗어나지 않는 범위에서 도 2에 기재된 순서를 변경하여 실행하거나 또는 하나 이상의 과정을 병렬적으로 실행하거나 다른 과정을 추가하는 것으로 다양하게 수정 및 변형하여 적용 가능할 것이다.Although FIG. 2 describes each process as being executed sequentially, this is merely an example, and those skilled in the art may modify and apply various modifications and variations, such as changing the order described in FIG. 2, executing one or more processes in parallel, or adding other processes, without departing from the essential characteristics of the embodiments of the present invention.

본 실시예들에 따른 동작은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능한 매체에 기록될 수 있다. 컴퓨터 판독 가능한 매체는 실행을 위해 프로세서에 명령어를 제공하는 데 참여한 임의의 매체를 나타낸다. 컴퓨터 판독 가능한 매체는 프로그램 명령, 데이터 파일, 데이터 구조 또는 이들의 조합을 포함할 수 있다. 예를 들면, 자기 매체, 광기록 매체, 메모리 등이 있을 수 있다. 컴퓨터 프로그램은 네트워크로 연결된 컴퓨터 시스템 상에 분산되어 분산 방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수도 있다. 본 실시예를 구현하기 위한 기능적인(Functional) 프로그램, 코드, 및 코드 세그먼트들은 본 실시예가 속하는 기술분야의 프로그래머들에 의해 용이하게 추론 될 수 있을 것이다.The operations according to the present embodiments may be implemented in the form of program commands that can be performed through various computer means and recorded on a computer-readable medium. The computer-readable medium refers to any medium that participates in providing commands to a processor for execution. The computer-readable medium may include program commands, data files, data structures, or a combination thereof. For example, there may be a magnetic medium, an optical recording medium, a memory, etc. The computer program may be distributed on a network-connected computer system so that the computer-readable code is stored and executed in a distributed manner. Functional programs, codes, and code segments for implementing the present embodiments may be easily inferred by programmers in the technical field to which the present embodiments belong.

이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위 내에서 다양한 수정, 변경 및 치환이 가능할 것이다. 따라서, 본 발명에 개시된 실시예 및 첨부된 도면들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예 및 첨부된 도면에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.The above description is merely an illustrative description of the technical idea of the present invention, and those skilled in the art will appreciate that various modifications, changes, and substitutions may be made without departing from the essential characteristics of the present invention. Accordingly, the embodiments disclosed in the present invention and the accompanying drawings are not intended to limit the technical idea of the present invention but to explain it, and the scope of the technical idea of the present invention is not limited by these embodiments and the accompanying drawings. The protection scope of the present invention should be interpreted by the following claims, and all technical ideas within a scope equivalent thereto should be interpreted as being included in the scope of the rights of the present invention.

Claims (18)

컴퓨터에 의해 수행되는 주식 투자 포트폴리오 결정 방법에 있어서,
상기 컴퓨터가, 주식 데이터로부터, 단순 그래프 기반 랭킹 모델 및 하이퍼그래프 기반 랭킹 모델을 통해 각각 복수의 주식들에 대한 랭킹을 예측하는 단계;
상기 컴퓨터가, 상기 주식 데이터로부터, 분류 모델을 통해 상기 복수의 주식들 각각에 대한 상승 확률을 예측하고, 회귀 모델을 통해 상기 복수의 주식들 각각에 대한 수익률을 예측하는 단계; 및
상기 컴퓨터가, 상기 단순 그래프 기반 랭킹 모델을 통해 예측된 랭킹과 상기 하이퍼그래프 기반 랭킹 모델을 통해 예측된 랭킹을 이용하여 주식들을 선택하는 단계; 및
상기 컴퓨터가, 상기 선택된 주식들에 대한 상기 예측된 상승 확률과 상기 예측된 수익률을 이용하여, 상기 선택된 주식들에 대한 투자 비율을 결정하는 단계를 포함하고,
상기 컴퓨터가, 상기 주식 데이터를 전처리하는 단계로서, 상기 주식 데이터로부터 캔들스틱 구성요소와 기술적 지표를 포함하는 특징들을 계산하고, 상기 특징들을 클러스터링하고, 클러스터 내의 특징들의 수가 소정 임계값보다 큰 각 클러스터 내의 특징들을 선택하고, 상기 선택된 특징들을 병합하는 전처리 단계를 더 포함하고,
상기 전처리 단계는, 각 주식에 대하여, 분류 모델에 대하여 병합된 특징과 회귀 모델에 대하여 병합된 특징을 교집합하여 공통 특징을 획득하고, 상기 각 주식에 대한 공통 특징을 결합하여 빈도가 높은 소정 개수의 특징을 선택하고, 상기 선택된 특징이 상기 단순 그래프 기반 랭킹 모델 및 상기 하이퍼그래프 기반 랭킹 모델에 사용되는 것을 특징으로 하는 주식 투자 포트폴리오 결정 방법.
In a method for determining a stock investment portfolio performed by a computer,
A step in which the computer predicts rankings for a plurality of stocks, respectively, from stock data using a simple graph-based ranking model and a hypergraph-based ranking model;
A step in which the computer predicts the probability of increase for each of the plurality of stocks through a classification model from the stock data, and predicts the rate of return for each of the plurality of stocks through a regression model; and
The step of the computer selecting stocks using the ranking predicted through the simple graph-based ranking model and the ranking predicted through the hypergraph-based ranking model; and
The computer comprises a step of determining an investment ratio for the selected stocks by using the predicted increase probability and the predicted return for the selected stocks,
The computer further includes a preprocessing step of calculating features including candlestick components and technical indicators from the stock data, clustering the features, selecting features within each cluster in which the number of features within the cluster is greater than a predetermined threshold, and merging the selected features, as a step of preprocessing the stock data.
A method for determining a stock investment portfolio, characterized in that the above preprocessing step obtains common features by intersecting the merged features for the classification model and the merged features for the regression model for each stock, combines the common features for each stock to select a predetermined number of features with a high frequency, and the selected features are used in the simple graph-based ranking model and the hypergraph-based ranking model.
제1항에 있어서,
상기 선택하는 단계는, 상기 단순 그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식과 상기 하이퍼그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식으로부터 주식들을 선택하는 것을 특징으로 하는 주식 투자 포트폴리오 결정 방법.
In the first paragraph,
A method for determining a stock investment portfolio, characterized in that the above-mentioned selecting step selects stocks from a top predetermined number of stocks predicted through the simple graph-based ranking model and a top predetermined number of stocks predicted through the hypergraph-based ranking model.
제2항에 있어서,
상기 선택하는 단계는, 상기 단순 그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식과 상기 하이퍼그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식을 교집합하여 주식들을 선택하는 것을 특징으로 하는 주식 투자 포트폴리오 결정 방법.
In the second paragraph,
A method for determining a stock investment portfolio, characterized in that the above-mentioned selecting step selects stocks by intersecting a predetermined number of top stocks predicted through the simple graph-based ranking model and a predetermined number of top stocks predicted through the hypergraph-based ranking model.
제1항에 있어서,
상기 결정하는 단계는, 상기 선택된 주식들에 대한 상기 예측된 상승 확률과 상기 예측된 수익률의 요소별 곱셈을 이용하여 투자 비율을 결정하는 것을 특징으로 하는 주식 투자 포트폴리오 결정 방법.
In the first paragraph,
A method for determining a stock investment portfolio, characterized in that the above-determining step determines an investment ratio by using the element-by-element multiplication of the predicted increase probability and the predicted return rate for the selected stocks.
삭제delete 제1항에 있어서,
상기 전처리 단계는, 상기 병합된 특징들의 차원을 축소하고, 차원이 축소된 특징들이 상기 분류 모델 및 상기 회귀 모델에 사용되는 것을 특징으로 하는 주식 투자 포트폴리오 결정 방법.
In the first paragraph,
A method for determining a stock investment portfolio, characterized in that the above preprocessing step reduces the dimension of the merged features, and the features with the reduced dimension are used in the classification model and the regression model.
삭제delete 제1항에 있어서,
상기 컴퓨터가, 상기 주식 데이터로부터 추출된 특징으로 구성되는 시계열 특징으로부터 LSTM(Long Short-Term Memory) 기반 시간적 모델을 통해 시간적 특징을 추출하는 단계를 더 포함하고,
상기 랭킹을 예측하는 단계 및 상기 상승 확률 및 상기 수익률을 예측하는 단계는, 상기 시간적 특징으로부터 예측하는 것을 특징으로 하는 주식 투자 포트폴리오 결정 방법.
In the first paragraph,
The computer further includes a step of extracting temporal features from time series features composed of features extracted from the stock data through a LSTM (Long Short-Term Memory) based temporal model,
A method for determining a stock investment portfolio, characterized in that the step of predicting the above ranking and the step of predicting the above increase probability and the above return are predicted from the above temporal characteristics.
제8항에 있어서,
상기 시간적 특징을 추출하는 단계는, 상기 시계열 특징에 LSTM 계층과 Hawkes 어텐션 메커니즘을 적용하고, 각 주식에 대한 Hawkes 어텐션의 출력이 상기 단순 그래프 기반 랭킹 모델 및 상기 하이퍼그래프 기반 랭킹 모델의 노드 특징 벡터로 사용되는 것을 특징으로 하는 주식 투자 포트폴리오 결정 방법.
In Article 8,
A method for determining a stock investment portfolio, characterized in that the step of extracting the temporal features applies an LSTM layer and a Hawkes attention mechanism to the time series features, and the output of the Hawkes attention for each stock is used as a node feature vector of the simple graph-based ranking model and the hypergraph-based ranking model.
제8항에 있어서,
상기 시간적 특징을 추출하는 단계는, 상기 시계열 특징에 제1 양방향 LSTM 계층, Hawkes 어텐션 메커니즘, 및 제2 양방향 LSTM 계층을 적용하고, 상기 제2 양방향 LSTM 계층의 출력이 상기 분류 모델 및 상기 회귀 모델의 입력 특징 벡터로 사용되는 것을 특징으로 하는 주식 투자 포트폴리오 결정 방법.
In Article 8,
A method for determining a stock investment portfolio, characterized in that the step of extracting the temporal features applies a first bidirectional LSTM layer, a Hawkes attention mechanism, and a second bidirectional LSTM layer to the time series features, and the output of the second bidirectional LSTM layer is used as an input feature vector of the classification model and the regression model.
제1항에 있어서,
상기 단순 그래프 기반 랭킹 모델은, 노드 레벨에서 그래프 어텐션 네트워크(GAT)를 사용하여 각 관계 유형에 대해서 이웃 노드들에 가중치를 할당하여 관계형 특징 벡터를 획득하고, 관계 유형 레벨에서 각 관계 유형에 대해서 어텐션 계수를 계산하고, 상기 어텐션 계수로 가중치된 상기 관계형 특징 벡터를 집계하여 최종 관계형 특징 벡터를 획득하고, 상기 최종 관계형 특징 벡터로부터 활성화 함수를 통해 랭킹 스코어를 예측하는 것을 특징으로 하는 주식 투자 포트폴리오 결정 방법.
In the first paragraph,
The above simple graph-based ranking model obtains a relational feature vector by assigning weights to neighboring nodes for each relationship type using a graph attention network (GAT) at the node level, calculates an attention coefficient for each relationship type at the relationship type level, aggregates the relational feature vectors weighted by the attention coefficients to obtain a final relational feature vector, and predicts a ranking score from the final relational feature vector through an activation function. A stock investment portfolio decision method.
제1항에 있어서,
상기 하이퍼그래프 기반 랭킹 모델은, 입력 특징 행렬로부터 멀티-헤드 어텐션 메커니즘이 적용된 하이퍼그래프 컨볼루션 계층 및 활성화 함수를 통해 랭킹 스코어를 예측하는 것을 특징으로 하는 주식 투자 포트폴리오 결정 방법.
In the first paragraph,
A stock investment portfolio decision method characterized in that the above hypergraph-based ranking model predicts a ranking score from an input feature matrix through a hypergraph convolution layer and an activation function to which a multi-head attention mechanism is applied.
프로세서 및 상기 프로세서에 의해 실행되는 프로그램을 저장하는 메모리를 포함하는 주식 투자 포트폴리오 결정 장치에 있어서,
상기 프로세서는,
주식 데이터로부터, 단순 그래프 기반 랭킹 모델 및 하이퍼그래프 기반 랭킹 모델을 통해 각각 복수의 주식들에 대한 랭킹을 예측하고,
상기 주식 데이터로부터, 분류 모델을 통해 상기 복수의 주식들 각각에 대한 상승 확률을 예측하고, 회귀 모델을 통해 상기 복수의 주식들 각각에 대한 수익률을 예측하고,
상기 단순 그래프 기반 랭킹 모델을 통해 예측된 랭킹과 상기 하이퍼그래프 기반 랭킹 모델을 통해 예측된 랭킹을 이용하여 주식들을 선택하고,
상기 선택된 주식들에 대한 상기 예측된 상승 확률과 상기 예측된 수익률을 이용하여, 상기 선택된 주식들에 대한 투자 비율을 결정하고,
상기 프로세서는, 상기 주식 데이터를 전처리하되, 상기 주식 데이터로부터 캔들스틱 구성요소와 기술적 지표를 포함하는 특징들을 계산하고, 상기 특징들을 클러스터링하고, 클러스터 내의 특징들의 수가 소정 임계값보다 큰 각 클러스터 내의 특징들을 선택하고, 상기 선택된 특징들을 병합하고,
상기 프로세서는, 상기 주식 데이터를 전처리함에 있어, 각 주식에 대하여, 분류 모델에 대하여 병합된 특징과 회귀 모델에 대하여 병합된 특징을 교집합하여 공통 특징을 획득하고, 상기 각 주식에 대한 공통 특징을 결합하여 빈도가 높은 소정 개수의 특징을 선택하고, 상기 선택된 특징이 상기 단순 그래프 기반 랭킹 모델 및 상기 하이퍼그래프 기반 랭킹 모델에 사용되는 것을 특징으로 하는 주식 투자 포트폴리오 결정 장치.
A stock investment portfolio decision device comprising a processor and a memory storing a program executed by the processor,
The above processor,
From stock data, we predict the rankings of multiple stocks using a simple graph-based ranking model and a hypergraph-based ranking model, respectively.
From the above stock data, the probability of increase for each of the multiple stocks is predicted through a classification model, and the rate of return for each of the multiple stocks is predicted through a regression model.
Select stocks using the ranking predicted by the above simple graph-based ranking model and the ranking predicted by the above hypergraph-based ranking model.
Using the predicted increase probability and predicted return for the selected stocks, the investment ratio for the selected stocks is determined,
The above processor preprocesses the stock data, calculates features including candlestick components and technical indicators from the stock data, clusters the features, selects features within each cluster in which the number of features within the cluster is greater than a predetermined threshold, and merges the selected features.
The above processor, in preprocessing the stock data, obtains common features by intersecting the merged features for the classification model and the merged features for the regression model for each stock, combines the common features for each stock to select a predetermined number of features with a high frequency, and the selected features are used in the simple graph-based ranking model and the hypergraph-based ranking model. A stock investment portfolio decision device.
제13항에 있어서,
상기 프로세서는, 상기 단순 그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식과 상기 하이퍼그래프 기반 랭킹 모델을 통해 예측된 상위 소정 개수의 주식으로부터 주식들을 선택하는 것을 특징으로 하는 주식 투자 포트폴리오 결정 장치.
In Article 13,
A stock investment portfolio decision device, characterized in that the processor selects stocks from a predetermined number of top stocks predicted through the simple graph-based ranking model and a predetermined number of top stocks predicted through the hypergraph-based ranking model.
삭제delete 제13항에 있어서,
상기 프로세서는, 상기 주식 데이터로부터 추출된 특징으로 구성되는 시계열 특징으로부터 LSTM(Long Short-Term Memory) 기반 시간적 모델을 통해 시간적 특징을 추출하고,
상기 프로세서는, 상기 시간적 특징으로부터 상기 랭킹, 상기 상승 확률, 및 상기 수익률을 예측하는 것을 특징으로 하는 주식 투자 포트폴리오 결정 장치.
In Article 13,
The above processor extracts temporal features from time series features composed of features extracted from the stock data through a LSTM (Long Short-Term Memory)-based temporal model,
A stock investment portfolio decision device, characterized in that the processor predicts the ranking, the increase probability, and the rate of return from the temporal features.
제13항에 있어서,
상기 단순 그래프 기반 랭킹 모델은, 노드 레벨에서 그래프 어텐션 네트워크(GAT)를 사용하여 각 관계 유형에 대해서 이웃 노드들에 가중치를 할당하여 관계형 특징 벡터를 획득하고, 관계 유형 레벨에서 각 관계 유형에 대해서 어텐션 계수를 계산하고, 상기 어텐션 계수로 가중치된 상기 관계형 특징 벡터를 집계하여 최종 관계형 특징 벡터를 획득하고, 상기 최종 관계형 특징 벡터로부터 활성화 함수를 통해 랭킹 스코어를 예측하는 것을 특징으로 하는 주식 투자 포트폴리오 결정 장치.
In Article 13,
The above simple graph-based ranking model is a stock investment portfolio decision device characterized in that it obtains a relational feature vector by assigning weights to neighboring nodes for each relationship type using a graph attention network (GAT) at the node level, calculates an attention coefficient for each relationship type at the relationship type level, aggregates the relational feature vectors weighted by the attention coefficients to obtain a final relational feature vector, and predicts a ranking score from the final relational feature vector through an activation function.
제13항에 있어서,
상기 하이퍼그래프 기반 랭킹 모델은, 입력 특징 행렬로부터 멀티-헤드 어텐션 메커니즘이 적용된 하이퍼그래프 컨볼루션 계층 및 활성화 함수를 통해 랭킹 스코어를 예측하는 것을 특징으로 하는 주식 투자 포트폴리오 결정 장치.
In Article 13,
The above hypergraph-based ranking model is a stock investment portfolio decision device characterized in that it predicts a ranking score from an input feature matrix through a hypergraph convolution layer and an activation function to which a multi-head attention mechanism is applied.
KR1020230027038A 2023-02-28 2023-02-28 Method and apparatus for determining stock investment portfolio Active KR102755618B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020230027038A KR102755618B1 (en) 2023-02-28 2023-02-28 Method and apparatus for determining stock investment portfolio

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020230027038A KR102755618B1 (en) 2023-02-28 2023-02-28 Method and apparatus for determining stock investment portfolio

Publications (2)

Publication Number Publication Date
KR20240133281A KR20240133281A (en) 2024-09-04
KR102755618B1 true KR102755618B1 (en) 2025-01-15

Family

ID=92759489

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020230027038A Active KR102755618B1 (en) 2023-02-28 2023-02-28 Method and apparatus for determining stock investment portfolio

Country Status (1)

Country Link
KR (1) KR102755618B1 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102198459B1 (en) * 2018-12-31 2021-01-05 인하대학교 산학협력단 Clustering method and system for financial time series with co-movement relationship
KR20220079785A (en) * 2020-12-04 2022-06-14 주식회사 와들 Apparatus and method for provision of user experience environment based on genetic algorithm
KR102597042B1 (en) * 2021-06-15 2023-10-31 김상율 Apparatus and method for providing stock market prediction service by using of machine learning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Stock Selection via Spatiotemporal Hypergraph Attention Network: A Learning to Rank Approach(AAAI-21, 2021.05.18.공개)*

Also Published As

Publication number Publication date
KR20240133281A (en) 2024-09-04

Similar Documents

Publication Publication Date Title
Tavakoli et al. An autoencoder-based deep learning approach for clustering time series data
Shobana et al. Forecasting by machine learning techniques and econometrics: A review
Osman Data mining techniques
Hsieh et al. Forecasting stock markets using wavelet transforms and recurrent neural networks: An integrated system based on artificial bee colony algorithm
Raju et al. An approach for demand forecasting in steel industries using ensemble learning
CN110717535B (en) Automatic modeling method and system based on data analysis processing system
Spedicato et al. Machine learning methods to perform pricing optimization. A comparison with standard GLMs
CN110674636B (en) A Method for Analyzing Power Consumption Behavior
Chang et al. Trend discovery in financial time series data using a case based fuzzy decision tree
CN119168028B (en) Knowledge-graph-fused digital accurate drainage and sale management method and system
Mehmanpazir et al. Development of an evolutionary fuzzy expert system for estimating future behavior of stock price
Akerkar Advanced data analytics for business
Qian et al. Short-term wind speed prediction with a two-layer attention-based LSTM
CN112396231A (en) Modeling method and device for spatio-temporal data, electronic equipment and readable medium
Liu et al. Deep inception networks: a general end-to-end framework for multi-asset quantitative strategies
Zhu et al. Automated machine learning with dynamic ensemble selection: X. Zhu et al.
Weng et al. Mining time series data for segmentation by using Ant Colony Optimization
Ganapathisamy et al. A Long Short-Term Memory with Recurrent Neural Network and Brownian Motion Butterfly Optimization for Employee Attrition Prediction.
Wang et al. A two-stage hybrid model by using artificial neural networks as feature construction algorithms
KR102755618B1 (en) Method and apparatus for determining stock investment portfolio
Zhao Research on the Application of Improved Decision Tree Algorithm based on Information Entropy in the Financial Management of Colleges and Universities
CN117807114B (en) Logistics information intelligent retrieval method, system, equipment and storage medium
Thammaboosadee et al. An integration of requirement forecasting and customer segmentation models towards prescriptive analytics for electrical devices production
Glezakos et al. Piecewise evolutionary segmentation for feature extraction in time series models
CN119477098B (en) A method, device, computer equipment and medium for determining watershed business relations

Legal Events

Date Code Title Description
PA0109 Patent application

Patent event code: PA01091R01D

Comment text: Patent Application

Patent event date: 20230228

PA0201 Request for examination

Patent event code: PA02011R01I

Patent event date: 20230228

Comment text: Patent Application

E902 Notification of reason for refusal
PE0902 Notice of grounds for rejection

Comment text: Notification of reason for refusal

Patent event date: 20240814

Patent event code: PE09021S01D

PG1501 Laying open of application
E701 Decision to grant or registration of patent right
PE0701 Decision of registration

Patent event code: PE07011S01D

Comment text: Decision to Grant Registration

Patent event date: 20250106

GRNT Written decision to grant
PR0701 Registration of establishment

Comment text: Registration of Establishment

Patent event date: 20250113

Patent event code: PR07011E01D

PR1002 Payment of registration fee

Payment date: 20250113

End annual number: 3

Start annual number: 1

PG1601 Publication of registration