WO2021082811A1 - Foreign exchange time series prediction method - Google Patents

Foreign exchange time series prediction method Download PDF

Info

Publication number
WO2021082811A1
WO2021082811A1 PCT/CN2020/116955 CN2020116955W WO2021082811A1 WO 2021082811 A1 WO2021082811 A1 WO 2021082811A1 CN 2020116955 W CN2020116955 W CN 2020116955W WO 2021082811 A1 WO2021082811 A1 WO 2021082811A1
Authority
WO
WIPO (PCT)
Prior art keywords
network
training
short
neural network
foreign exchange
Prior art date
Application number
PCT/CN2020/116955
Other languages
French (fr)
Chinese (zh)
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 山东科技大学
Publication of WO2021082811A1 publication Critical patent/WO2021082811A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • G06F18/2135Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0639Performance analysis of employees; Performance analysis of enterprise or organisation operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Definitions

  • Dash Rajashree proposed an evolutionary framework that uses an improved hybrid leapfrog algorithm and artificial neural network to predict foreign exchange time series data. And compared with the hybrid leapfrog algorithm and particle swarm optimization algorithm, the experiment shows that the model proposed in the article is more suitable for foreign exchange time series analysis.
  • the long and short-term memory network is performed separately, and the output of the two algorithms is combined to make the final prediction.
  • Figure 14 is a graph showing the change trend of training speed with the increase in the number of GPUs
  • Figure 19 is a fitting diagram of the prediction effect of the LSTM prediction method
  • RSV N (Close (N) -Low (N) ) ⁇ (High (N) -Low (N) ) ⁇ 100% (8)
  • the number of lag periods n refers to the length of the analysis and prediction time series, that is, the n+1 day is predicted using the data of the previous n days.
  • the difference in the number of lag periods may have an important impact on forecast accuracy.
  • choose 5, 10, 20, 30, 40, 50, 60 different lag periods study the influence of the lag period n on the prediction accuracy, and select the best lag period n.
  • the detailed laboratory data is shown in Table 3, and the data in Table 3 is visualized to get Figure 6.
  • the convolution kernel is 1 ⁇ 1
  • the convolution kernel is larger than 3 ⁇ 3
  • the spatial features around the data are collected too much .
  • the prediction accuracy shows that the location far away from the data has less correlation with the current data.
  • the number of convolutional layers is 2 and the convolution sum size is 3 ⁇ 3, the spatial characteristics of the data are better abstracted. Therefore, the number of convolutional layers is set to 2, and the size of the convolution kernel is set. It is 3 ⁇ 3.

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Entrepreneurship & Innovation (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Tourism & Hospitality (AREA)
  • Game Theory and Decision Science (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Educational Administration (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Technology Law (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

Disclosed is a foreign exchange time series prediction method, relating to the field of foreign exchange time series data. According to the prediction method, foreign exchange time series data is analyzed and predicted on the basis of a deep learning algorithm C-LSTM, which combines a convolutional neural network with a long short-term memory network, and a short-term prediction method for a foreign exchange time series is proposed. Three kinds of main factors affecting the prediction precision are systematically studied. The optimal input feature, network structure and training method are selected. As for the problem of big data noise, a feature optimization algorithm is constructed on the basis of PCA to perform dimension reduction and denoising on input features, and Dropout and L2 regularization methods are then used to avoid the problem of over-fitting, thereby further improving the prediction precision of the prediction method. At the same time, in order to meet the requirement of a foreign exchange market for high time effectiveness, a parallel optimization algorithm is constructed on the basis of high-performance GPU computing technology, thereby increasing the training speed of a network model and improving the availability of the prediction method in actual application scenarios.

Description

一种外汇时间序列预测方法A foreign exchange time series forecasting method 技术领域Technical field
本发明涉及外汇时间序列数据领域,具体涉及一种外汇时间序列预测方法。The invention relates to the field of foreign exchange time series data, in particular to a foreign exchange time series forecasting method.
背景技术Background technique
外汇市场对世界经济的健康发展起到关键作用,外汇时间序列数据波动剧烈,影响其波动的因素众多,是金融市场中最难分析预测的金融衍生品之一,传统的分析预测方法早已力不从心。在大数据时代,随着数据量的不断增长和计算力的迅速提高,深度学习技术在图像识别、自然语言处理、语音识别等领域取得了重大突破,许多学者开始将深度学习技术应用到外汇时间序列分析中,并已取得一定的研究成果,但由于外汇时间序列数据噪声大,随机性强,影响其波动的因素众多,因此,深度学习技术在外汇时间序列分析中的应用研究还需不断探究和完善。The foreign exchange market plays a key role in the healthy development of the world economy. The foreign exchange time series data fluctuates sharply, and there are many factors that affect its fluctuations. It is one of the most difficult financial derivatives to analyze and predict in the financial market. Traditional analysis and prediction methods have long been unable to do so. In the era of big data, with the continuous growth of data volume and the rapid improvement of computing power, deep learning technology has made major breakthroughs in image recognition, natural language processing, speech recognition and other fields. Many scholars have begun to apply deep learning technology to foreign exchange time. In the sequence analysis, certain research results have been obtained. However, due to the large noise and strong randomness of foreign exchange time series data, there are many factors affecting its fluctuations. Therefore, the application research of deep learning technology in foreign exchange time series analysis needs to be explored continuously. And perfect.
目前,外汇时间序列主要有两类分析方法:At present, there are mainly two types of analysis methods for foreign exchange time series:
(1)传统统计学方法(1) Traditional statistical methods
传统统计学方法通过统计学方法建立数学模型,拟合历史外汇时间序列数据,然后通过所建模型预测未来外汇时间序列。常见的方法有MA(Moving Average,移动平均)模型,ARIMA(AutoRegressive Integrated Moving Average,自回归移动平均)模型和GARCH(Generalized AutoRegressive Conditional Heteroskedasticity,广义自回归条件异方差模型)模型等 [1]。传统统计学方法对数据依赖较小,只需历史外汇时间序列的趋势曲线即可构建模型,具有很强的通用性。但其存在滞后性问题,预测值晚于真实值,而且对于复杂性较高的系统,传统统计学方法无法有效的挖掘系统的内在规律,使得传统的统计学方法对于金融时间序列的分析预测效果并不理想。 Traditional statistical methods use statistical methods to establish mathematical models, fit historical foreign exchange time series data, and then use the built models to predict future foreign exchange time series. Common methods include MA (Moving Average) model, ARIMA (AutoRegressive Integrated Moving Average) model and GARCH (Generalized AutoRegressive Conditional Heteroskedasticity, generalized autoregressive conditional heteroscedasticity) model, etc. [1] . Traditional statistical methods rely less on data, and only need the trend curve of historical foreign exchange time series to build a model, which has strong versatility. However, it has the problem of lag, the predicted value is later than the true value, and for systems with high complexity, traditional statistical methods cannot effectively mine the internal laws of the system, which makes the traditional statistical methods of financial time series analysis and forecasting effects Not ideal.
(2)神经网络方法(2) Neural network method
神经网络可以较好的拟合复杂的非线性系统,因此对于外汇时间序列的分析预测有着巨大潜力,因此,许多学者利用神经网络方法对外汇时间序列进行分析预测,并取得了大量的研究成果。常见的方法有BP神经网络、径向基神经网络、小波神经网络等 [2]。但是浅层的神经网络方法学习能力有限,无法较好的拟合外汇时间序列数据,分析预测效果虽然优于传统的统计学方法,但仍有很大的提升空间。 Neural network can better fit complex nonlinear systems, so it has great potential for the analysis and prediction of foreign exchange time series. Therefore, many scholars use neural network methods to analyze and forecast foreign exchange time series and have obtained a lot of research results. Common methods include BP neural network, radial basis neural network, wavelet neural network, etc. [2] . However, the learning ability of shallow neural network methods is limited and cannot fit foreign exchange time series data well. Although the analysis and forecasting effect is better than traditional statistical methods, there is still a lot of room for improvement.
深度学习技术很好的弥补了浅层神经网络学习能力不足的问题,因此在外汇时间序列分析中有更好的应用前景,但深度学习算法结构复杂,影响其预测精度的因素众多,样本特征、算法结构、训练优化方法等主观性因素对模型预测精度有重要的影响,研究这些因素对于提高深度学习算法在外汇时间序列中的预测精度有重要意义。此外,目前深度学习算法在外汇时间序列分析中的应用以单一结构为主,如何将不同深度学习算法进行有效结合,优势互补,以进一步提高深度学习算法的预测精度,还需不断探究与完善。Deep learning technology makes up for the lack of learning ability of shallow neural networks, so it has better application prospects in foreign exchange time series analysis, but the structure of deep learning algorithms is complex, and there are many factors that affect its prediction accuracy, such as sample characteristics, Subjective factors such as algorithm structure and training optimization method have an important impact on the model's prediction accuracy. Researching these factors is of great significance for improving the prediction accuracy of deep learning algorithms in foreign exchange time series. In addition, the current application of deep learning algorithms in foreign exchange time series analysis is based on a single structure. How to effectively combine different deep learning algorithms with complementary advantages to further improve the prediction accuracy of deep learning algorithms requires continuous exploration and improvement.
早在20世纪末,MarkStaley和PcterKim已将简单的人工神经网络成功应用于外汇时间序列分析,通过分析预测加拿大即期汇率,证明了神经网络方法在外汇时间序列分析中的有效性。之后,惠晓峰和胡运权等使用人工神经网络预测人民币对美元汇率,并与传统的统计分析方法进行实验对比,实验数据表明,神经网络方法优于传统的统计分析方法。Jingtao Yao和Chew Lim Tan使用神经网络方法分析预测了美元与其他五种主要货币对之间的汇率时间序列,充分证明了神经网络算法在外汇时间序列分析中的良好适用性,但也指出,仅依靠神经网络算法难以在外汇市场中获取高额收益。因此,许多研究者开始采用组合模型的方式提升对外汇时间序列的预测效果。如欧阳亮将小波分析方法融合到神经网络算法中,构建了小波神经网络预测方法,提高了神经网络的泛化能力。He Ni和Yin Hujun组合多种回归神经网络构建混合预测模型,并使用遗传算法对模型进行优化,实验表明,该混合预测模型有较高的利润回报率。Georgios Sermpinis和Konstantinos Theofilatos等基于自适应径向基神经网络构建外汇时间序列分析模型,并使用粒子群优化算法进行优化,实验数据表明,该模型在精度和速度方面均有较大提升。Lukas F等基于径向基神经网络,组合遗传算法和移动平均线构建了外汇时间序列预测模型,并在美元兑加元高频时间序列数据上进行实验分析,实验数据表明,该模型比自回归模型和BP神经网络模型具有更高的预测精度。Kristjanpoller W和Minutolo M C通过使用神经网络和GARCH的混合模型,并纳入多个金融变量来预测油价的波动性,实验表明,该混合模型较以前的模型提高了30%的预测精度。Petropoulos A等智能结合各种机器学习模型,研究开发了自动外汇投资组合交易系统,该系统使用支持向量机、随机森林、贝叶斯回归树、全连接神经网络和朴素贝叶斯分类器来模拟主要货币对之间的依赖模式,根据这些模型的输出产生汇率波动的隐含信号,最终通过多数投票,遗传算法优化和回归加权技术将这些隐含信号组合成聚合预测波形。在实际交易中测试该系统,测试结果表明,该系统可以显著提高交易绩效。Dash Rajashree提出了一种进化框架,使用改进的混合蛙跳算法和人工神经网络来预测外汇时间序列数据。并与混合蛙跳算法和粒子群优化算法进行实验对比,实验表明,文中提出的模型更适用于外汇时间序列分析。As early as the end of the 20th century, MarkStaley and PcterKim had successfully applied simple artificial neural networks to foreign exchange time series analysis. Through analysis and forecasting of Canadian spot exchange rates, they proved the effectiveness of neural network methods in foreign exchange time series analysis. Later, Hui Xiaofeng, Hu Yunquan and others used artificial neural networks to predict the exchange rate of RMB against the US dollar, and compared them with traditional statistical analysis methods. Experimental data showed that neural network methods are superior to traditional statistical analysis methods. Jingtao Yao and Chew Lim Tan used neural network methods to analyze and predict the exchange rate time series between the U.S. dollar and the other five major currency pairs, which fully proved the good applicability of neural network algorithms in foreign exchange time series analysis, but they also pointed out that only It is difficult to obtain high returns in the foreign exchange market by relying on neural network algorithms. Therefore, many researchers have begun to adopt a combination model to improve the forecasting effect of foreign exchange time series. For example, Ouyang Liang merged the wavelet analysis method into the neural network algorithm, constructed the wavelet neural network prediction method, and improved the generalization ability of the neural network. He Ni and Yin Hujun combined multiple regression neural networks to construct a hybrid forecasting model, and used genetic algorithms to optimize the model. Experiments show that the hybrid forecasting model has a higher return on profit. Georgios Sermpinis and Konstantinos Theofilatos built a foreign exchange time series analysis model based on an adaptive radial basis function neural network, and optimized it with a particle swarm optimization algorithm. Experimental data shows that the model has a significant improvement in accuracy and speed. Lukas F et al. built a foreign exchange time series forecasting model based on a radial basis neural network, a combination of genetic algorithms and moving averages, and conducted an experimental analysis on the high-frequency time series data of the US dollar against the Canadian dollar. The experimental data showed that the model is more autoregressive. The model and BP neural network model have higher prediction accuracy. Kristjanpoller W and Minutolo M C use a hybrid model of neural network and GARCH, and incorporate multiple financial variables to predict the volatility of oil prices. Experiments show that the hybrid model has a 30% higher prediction accuracy than the previous model. Petropoulos A and other intelligence combined various machine learning models to research and develop an automatic foreign exchange portfolio trading system, which uses support vector machines, random forests, Bayesian regression trees, fully connected neural networks and naive Bayes classifiers to simulate The dependence patterns between major currency pairs generate implicit signals of exchange rate fluctuations based on the output of these models, and finally combine these implicit signals into aggregate forecast waveforms through majority voting, genetic algorithm optimization and regression weighting technology. The system is tested in actual transactions, and the test results show that the system can significantly improve transaction performance. Dash Rajashree proposed an evolutionary framework that uses an improved hybrid leapfrog algorithm and artificial neural network to predict foreign exchange time series data. And compared with the hybrid leapfrog algorithm and particle swarm optimization algorithm, the experiment shows that the model proposed in the article is more suitable for foreign exchange time series analysis.
以上研究多基于浅层神经网络算法,但外汇时间序列波动大,随机性强,浅层神经网络算法难以充分挖掘外汇时间序列的内在规律。随着深度学习技术的快速发展,深度学习技术在图像识别,语音识别,自然语音处理等领域取得了重大突破,因此,深度学习技术在金融时间序列分析中的应用研究也受到众多学者的关注。The above studies are mostly based on shallow neural network algorithms, but the foreign exchange time series are volatile and random. The shallow neural network algorithms are difficult to fully explore the internal laws of foreign exchange time series. With the rapid development of deep learning technology, deep learning technology has made major breakthroughs in image recognition, speech recognition, natural speech processing and other fields. Therefore, the application of deep learning technology in financial time series analysis has also attracted the attention of many scholars.
Jing Chao等使用一种改进的深度信念网络(DBN)分析预测外汇时间序列数据,文中通过使用连续的受限玻尔兹曼机来构建DBN,并改进了经典的DBN模型来预测连续数据,使用共轭梯度下降法加速DBN的训练。在实验中,采用六种评估标准,对三种外汇序列数据进行测试,实验数据表明,该预测方法优于前馈神经网络等预测方法。Korczak Jerzy和Hernes Marcin基于CNN深度学习算法构建了支持外汇市场交易决策的模型,实验表明,深度卷积神经网络对外汇时间序列数据的预测误差显著下降。Galeshchuk S和Mukherjee S基于深度学习算法对新兴市场的外汇时间序列数据进行预测,提出了基于货币集群的新颖输入特征,实验表明,该输入特征有助于提高深度学习算法的预测准确率。Dadabada Pradeepkumar和 Vadlamani Ravi提出了一种新颖的粒子群优化的分位数递归神经网络算法用于分析预测外汇时间序列等金融数据,文中使用八种金融时间序列数据进行实验分析,实验数据表明,该算法优于广义自回归条件异方差(GARCH)、多层感知器(MLP)、广义回归神经网络(GRNN)、随机森林(RF)等模型。Fischer T和Krauss C基于长短期记忆(LSTM)深度神经网络预测金融时间序列数据,实验表明,长短期记忆网络的预测效果优于逻辑回归、随机森林和传统RNN算法。Troiano L和Villa E M等基于LSTM构建交易机器人,识别技术指标给出的市场情绪和投资决策之间的逻辑,实验结果证明了该方案的可行性。Jing Chao et al. used an improved deep belief network (DBN) to analyze and predict foreign exchange time series data. In this paper, a continuous restricted Boltzmann machine was used to construct DBN, and the classic DBN model was improved to predict continuous data. The conjugate gradient descent method accelerates the training of DBN. In the experiment, six evaluation criteria were used to test three kinds of foreign exchange sequence data. The experimental data showed that the prediction method is superior to the prediction methods such as feedforward neural network. Korczak Jerzy and Hernes Marcin built a model that supports foreign exchange market trading decisions based on the CNN deep learning algorithm. Experiments show that the prediction error of the deep convolutional neural network on foreign exchange time series data is significantly reduced. Galeshchuk S and Mukherjee S predict foreign exchange time series data in emerging markets based on deep learning algorithms, and propose novel input features based on currency clusters. Experiments show that this input feature helps improve the prediction accuracy of deep learning algorithms. Dadabada Pradeepkumar and Vadlamani Ravi proposed a novel particle swarm optimization quantile recurrent neural network algorithm for analyzing and predicting financial data such as foreign exchange time series. The paper uses eight types of financial time series data for experimental analysis. The experimental data shows that The algorithm is better than generalized autoregressive conditional heteroscedasticity (GARCH), multi-layer perceptron (MLP), generalized regression neural network (GRNN), random forest (RF) and other models. Fischer T and Krauss C predict financial time series data based on long and short-term memory (LSTM) deep neural networks. Experiments show that the prediction effect of long-term and short-term memory networks is better than logistic regression, random forest and traditional RNN algorithms. Troiano L and Villa E M build trading robots based on LSTM to identify the logic between market sentiment given by technical indicators and investment decisions. Experimental results prove the feasibility of the solution.
综上所述,由于浅层神经网络本身的局限性以及深度学习技术的发展,学者们开始基于深度神经网络对金融时间序列进行研究。卷积神经网络考虑数据的空间特征,能真实的模拟神经组织学习的过程,该算法对具有空间上相关性质的序列数据有较好的处理效果。长短期记忆网络考虑数据的时序性,能更真实模拟了神经组织的认知过程,该算法对具有时间上相关性质的序列数据产生较为良好的处理效果。但是它们结构复杂,影响其性能的因素较多。目前,对于两种算法的有效结合以及训练学习过程中具体的输入特征选择、网络结构、训练方法对预测精度的影响并没有进行系统的研究。In summary, due to the limitations of shallow neural networks and the development of deep learning technology, scholars have begun to study financial time series based on deep neural networks. The convolutional neural network considers the spatial characteristics of the data and can truly simulate the process of neural tissue learning. The algorithm has a good processing effect on the spatially correlated sequence data. The long and short-term memory network considers the time sequence of the data and can more realistically simulate the cognitive process of neural tissue. This algorithm produces a relatively good processing effect on the sequence data with time-related nature. However, their structure is complex, and there are many factors that affect their performance. At present, the effective combination of the two algorithms and the impact of specific input feature selection, network structure, and training methods on the prediction accuracy in the training and learning process have not been systematically studied.
发明内容Summary of the invention
本发明的目的是针对上述不足,基于多种外汇货币数据为研究样本,基于卷积神经网络和长短期记忆网络相结合的C-LSTM构建外汇时间序列短期预测方法,将卷积深度神经网络和长短期记忆网络两种深度学习算法进行有效结合,对影响预测精度的因素进行系统地研究,并运用主成分分析以及dropout、L2正则化方法进行优化,最终构建了一种具有较高预测精度的C-LSTM外汇时间序列短期预测方法。The purpose of the present invention is to address the above shortcomings, based on a variety of foreign exchange currency data as research samples, based on the combination of convolutional neural network and long-term short-term memory network C-LSTM to construct a foreign exchange time series short-term prediction method, and convolutional deep neural network and The long and short-term memory network two deep learning algorithms are effectively combined, the factors that affect the prediction accuracy are systematically studied, and the principal component analysis, dropout, and L2 regularization methods are used to optimize, and finally a high prediction accuracy is constructed. C-LSTM foreign exchange time series short-term forecasting method.
本发明具体采用如下技术方案:The present invention specifically adopts the following technical solutions:
一种外汇时间序列预测方法,包括以下步骤:A foreign exchange time series forecasting method, including the following steps:
步骤1,构建基于卷积神经网络和长短期记忆网络相结合的C-LSTM的预测方法,具体包括: Step 1. Construct a C-LSTM prediction method based on the combination of convolutional neural network and long short-term memory network, which specifically includes:
1-1,构建基于卷积神经网络和长短期记忆网络相结合的C-LSTM的网络模型,具体包括:1-1. Construct a C-LSTM network model based on the combination of convolutional neural network and long short-term memory network, including:
1-1-1,构建包括输入层、隐藏层、输出层、网络训练和网络预测的五个功能模块;1-1-1, build five functional modules including input layer, hidden layer, output layer, network training and network prediction;
1-1-2,构建基于卷积神经网络和长短期记忆网络相结合的C-LSTM的外汇时间序列短期预测方法的训练和预测算法;1-1-2, construct training and prediction algorithms for the C-LSTM short-term prediction method of foreign exchange time series based on the combination of convolutional neural network and long short-term memory network;
1-2,选择卷积神经网络和长短期记忆网络相结合的C-LSTM的激活函数;1-2. Choose the activation function of C-LSTM that combines convolutional neural network and long-term short-term memory network;
1-3,定义卷积神经网络和长短期记忆网络相结合的C-LSTM的损失函数;1-3, define the loss function of C-LSTM combining convolutional neural network and long short-term memory network;
1-4,选择交易类指标和基本面数据作为卷积神经网络和长短期记忆网络相结合的C-LSTM的输入特征;1-4. Select transaction indicators and fundamental data as the input features of C-LSTM combined with convolutional neural network and long- and short-term memory network;
步骤2,从输入特征、网络结构和训练方法三个方面对步骤1构建的方法进行训练优化, 训练优化项目包括主成分分析的特征优化、卷积神经网络和长短期记忆网络相结合的C-LSTM滞后期数优化、卷积神经网络和长短期记忆网络网络相结合的C-LSTM结构优化、卷积神经网络和长短期记忆网络相结合的C-LSTM训练方法优化、基于GPU的并行优化; Step 2. Train and optimize the method constructed in Step 1 from the three aspects of input features, network structure and training methods. The training optimization items include feature optimization of principal component analysis, convolutional neural network and long- and short-term memory network combined C- LSTM lag period optimization, C-LSTM structure optimization combining convolutional neural network and long short-term memory network, C-LSTM training method optimization combining convolutional neural network and long short-term memory network, GPU-based parallel optimization;
输入特征方面,选取18个指标数据作为输入特征,18个指标数据分为四大类:基本交易数据、技术指标数据、美元指数和国家经济指标,将这四类指标进行组合,并基于主成分分析法进行输入特征的优化,研究不同指标对预测精度的影响并选取最佳的输入特征,然后实验研究滞后期数对预测精度的影响,从而选择最佳的滞后期数;In terms of input features, 18 indicator data are selected as input features. The 18 indicator data are divided into four categories: basic transaction data, technical indicator data, dollar index and national economic indicators. These four types of indicators are combined and based on principal components. The analysis method optimizes the input features, studies the impact of different indicators on the prediction accuracy and selects the best input features, and then experimentally studies the impact of the number of lag periods on the prediction accuracy, so as to select the best number of lag periods;
网络结构方面,根据网格搜索算法研究最佳的隐藏层结构大小,通过改变不同的卷积神经网络和长短期记忆网络的结合方式,研究不同的算法结合方式对预测精度的影响,选择最佳的隐藏层大小和算法结合方式;In terms of network structure, according to the grid search algorithm to study the best hidden layer structure size, by changing the combination of different convolutional neural networks and long and short-term memory networks, to study the impact of different algorithm combinations on the prediction accuracy, and choose the best The hidden layer size and algorithm combination method;
训练方法方面,采用Adam、SGD以及RMSProp方法进行网络的训练,通过对比训练后的算法预测精度以及在训练过程中,损失函数随迭代次数的变化情况和收敛速度,研究不同的训练方法对训练效果和预测精度的影响,最终选择合适的训练方法。In terms of training methods, the Adam, SGD, and RMSProp methods are used to train the network. By comparing the prediction accuracy of the training algorithm and the change of the loss function with the number of iterations and the convergence speed during the training process, the effect of different training methods on the training is studied. And the impact of prediction accuracy, and finally choose the appropriate training method.
优选地,所述步骤1中选择relu函数作为卷积神经网络和长短期记忆网络相结合的C-LSTM的激活函数,网络结构中加入激活函数后,神经网络具有非线性系统的拟合能力。Preferably, in the step 1, the relu function is selected as the activation function of the C-LSTM that combines the convolutional neural network and the long- and short-term memory network. After the activation function is added to the network structure, the neural network has the fitting ability of a nonlinear system.
优选地,所述步骤1中,选用均方误差作为损失函数,损失函数为式(1)所示,Preferably, in the step 1, the mean square error is selected as the loss function, and the loss function is shown in formula (1),
Figure PCTCN2020116955-appb-000001
Figure PCTCN2020116955-appb-000001
其中,y i为数据序列batch中第i个数据所对应的正确答案,
Figure PCTCN2020116955-appb-000002
为第i个数据所对应的神经网络预测值。
Among them, y i is the correct answer corresponding to the i-th data in the data sequence batch,
Figure PCTCN2020116955-appb-000002
Is the predicted value of the neural network corresponding to the i-th data.
优选地,所述步骤1中,通过交易类指标计算得出技术指标,常用的技术指标包括移动平行线和平滑异同移动平行线,移动平行线和平滑异同移动平行线用于反映当前汇价变动的趋势,通过反趋势指标判断趋势转折点,反趋势指标包括随机指标、乖离率、相对强弱指标和价格变动率。Preferably, in the step 1, the technical indicators are calculated by trading indicators. Commonly used technical indicators include moving parallel lines and smooth similarities and differences moving parallel lines. Moving parallel lines and smoothing similarities and differences moving parallel lines are used to reflect current exchange rate changes. Trend, the trend turning point is judged by counter-trend indicators. Counter-trend indicators include stochastic indicators, deviation rates, relative strength indicators, and price changes.
优选地,所述移动平行线指标是计算某段时期内汇率收盘价的平均值,以该平均值作为判断趋势变化的依据,具体计算公式如式(2)所示,Preferably, the moving parallel line index is to calculate the average value of the closing price of the exchange rate in a certain period of time, and the average value is used as the basis for judging the trend change. The specific calculation formula is as shown in formula (2).
Figure PCTCN2020116955-appb-000003
Figure PCTCN2020116955-appb-000003
其中,N代表时间周期,close i代表第i天的收盘价; Among them, N represents the time period, close i represents the closing price of the i-th day;
选取快速移动平均线和慢速移动平均线,再求出DIF的平滑移动平均线DEA,最后得出 平滑异同移动平均线,具体计算如式(3)-(7)所示,Select the fast moving average and the slow moving average, and then calculate the DIF smooth moving average DEA, and finally get the smooth moving average of similarity and difference, the specific calculation is shown in formulas (3)-(7),
Figure PCTCN2020116955-appb-000004
Figure PCTCN2020116955-appb-000004
Figure PCTCN2020116955-appb-000005
Figure PCTCN2020116955-appb-000005
Figure PCTCN2020116955-appb-000006
Figure PCTCN2020116955-appb-000006
Figure PCTCN2020116955-appb-000007
Figure PCTCN2020116955-appb-000007
BAR=2×(DIF-DEA)                       (7)BAR=2×(DIF-DEA) (7)
在式(3)-(7)中,EMA -1为前一日的指数移动平均值,Close为今日收盘价,BAR即为MACD柱状图的高度值。 In formulas (3)-(7), EMA -1 is the exponential moving average of the previous day, Close is today's closing price, and BAR is the height of the MACD histogram.
优选地,随机指标的具体计算式如式(8)-(11)所示,Preferably, the specific calculation formula of the stochastic index is shown in formulas (8)-(11),
RSV N=(Close (N)-Low (N))÷(High (N)-Low (N))×100%       (8) RSV N = (Close (N) -Low (N) )÷(High (N) -Low (N) )×100% (8)
Figure PCTCN2020116955-appb-000008
Figure PCTCN2020116955-appb-000008
Figure PCTCN2020116955-appb-000009
Figure PCTCN2020116955-appb-000009
J=3×K-2×D                  (11)J=3×K-2×D (11)
其中,Close (N)为N日内收盘价平均值,Low (N)为N日内的最低价,High (N)为N日内的最高价,K -1为前一日K值,D -1为前一日D值; Among them, Close (N) is the average closing price in N days, Low (N) is the lowest price in N days, High (N) is the highest price in N days, K -1 is the K value of the previous day, and D -1 is D value of the previous day;
乖离率的具体计算式如式(12),The specific calculation formula of the deviation rate is as formula (12),
Figure PCTCN2020116955-appb-000010
Figure PCTCN2020116955-appb-000010
其中,Close为当日收盘价,N为时间周期,取值为12;Among them, Close is the closing price of the day, N is the time period, and the value is 12;
相对强弱指标的计算式如式(13),The calculation formula of the relative strength index is as formula (13),
Figure PCTCN2020116955-appb-000011
Figure PCTCN2020116955-appb-000011
其中,Rise i是第i日收盘价涨幅,Fall i是第i日收盘价跌幅; Among them, Rise i is the increase in the closing price on the i day, and Fall i is the decrease in the closing price on the i day;
价格变动率的计算公式为式(14),The formula for calculating the rate of price change is equation (14),
ROC=Close÷Close -N                 (14) ROC=Close÷Close -N (14)
其中,Close是当日收盘价,Close -N前N日的收盘价。 Among them, Close is the closing price of the day, and Close -N is the closing price of the previous N days.
优选地,步骤2中,基于PCA构建特征优化算法,对输入特征进行降维除燥。Preferably, in step 2, a feature optimization algorithm is constructed based on PCA, and the input features are reduced in dimensionality.
优选地,基于PCA构建特征优化算法步骤具体为:Preferably, the steps of constructing a feature optimization algorithm based on PCA are specifically as follows:
对输入的n维特征矩阵D进行中心化处理,即每列数据均减去该列均值μ;Perform centralization processing on the input n-dimensional feature matrix D, that is, each column of data is subtracted from the column mean μ;
计算中心化后的输入特征矩阵的协方差矩阵S;Calculate the covariance matrix S of the input feature matrix after centering;
对计算出的协方差矩阵的特征值λ及其对应的特征向量ω,并将特征值从大到小排序λ 12,…,λ nFor the calculated eigenvalue λ of the covariance matrix and its corresponding eigenvector ω, and sort the eigenvalues from large to small λ 1 , λ 2 ,..., λ n ;
取前k大特征值λ 12,…,λ k对应的特征向量ω 12,…,ω k,通过式(15)将n维特征映射到k维, Take the eigenvectors ω 1 , ω 2 ,..., ω k corresponding to the first k large eigenvalues λ 1 , λ 2 ,..., λ k , and map the n-dimensional features to k-dimensional through equation (15),
Figure PCTCN2020116955-appb-000012
Figure PCTCN2020116955-appb-000012
新的x′ i的第k维就是x i在第k个主成分ω k方向上的投影,通过选取最大的k个特征值对应的特征向量,将方差较小的特征丢弃,使得每个n维列向量被映射为k维列向量x′ i,得到k维的特征矩阵D′。 The k- th dimension of the new x′ i is the projection of x i in the direction of the k-th principal component ω k . By selecting the eigenvectors corresponding to the largest k eigenvalues, the features with the smaller variance are discarded, so that each n The dimensional column vector is mapped to a k-dimensional column vector x′ i , and a k-dimensional feature matrix D′ is obtained.
优选地,步骤2中卷积神经网络和长短期记忆网络相结合的C-LSTM网络结构优化包括以下部分:Preferably, the optimization of the C-LSTM network structure combining the convolutional neural network and the long short-term memory network in step 2 includes the following parts:
长短期记忆网络循环层超参数优化;Hyperparameter optimization of cyclic layer of long-short-term memory network;
卷积层超参数优化;Convolutional layer hyperparameter optimization;
算法结合方式优化,卷积神经网络和长短期记忆网络的结合方式包括:The algorithm combination method is optimized. The combination method of convolutional neural network and long short-term memory network includes:
先卷积神经网络后长短期记忆网络,卷积神经网络层的输出作为长短期记忆网络层的输入;The convolutional neural network is first followed by the long and short-term memory network, and the output of the convolutional neural network layer is used as the input of the long and short-term memory network layer;
先长短期记忆网络后卷积神经网络,长短期记忆网络层的输出作为卷积神经网络层的输入;The long-short-term memory network is first followed by the convolutional neural network, and the output of the long-short-term memory network layer is used as the input of the convolutional neural network layer;
卷积神经网络后长短期记忆网络分别进行,结合两种算法的输出做最终的预测。After the convolutional neural network, the long and short-term memory network is performed separately, and the output of the two algorithms is combined to make the final prediction.
优选地,所述步骤2中,采用Adam、SGD以及RMSProp方法进行网络的训练,选择使用RMSProp训练优化方法,RMSProp训练优化方法收敛速度快,训练过程最稳定,训练优化效果最好。Preferably, in the step 2, the Adam, SGD, and RMSProp methods are used for network training, and the RMSProp training optimization method is selected. The RMSProp training optimization method has a fast convergence speed, the most stable training process, and the best training optimization effect.
本发明具有如下有益效果:The present invention has the following beneficial effects:
该预测方法基于CNN和LSTM两种深度神经网络相结合的C-LSTM,算法对外汇时间序列数据进行分析预测,提出并构建了C-LSTM外汇时间序列短期预测方法。对影响其预测精度的3类主要因素(训练样本、网络结构、训练方法)进行系统的研究,并基于主成分分析方法构建了特征优化算法,对输入特征进行降维除噪,然后运用Dropout和L2正则化方法避免过拟合问题的出现,进一步提高预测方法对外汇数据的预测精度。为满足外汇市场的高时效性需求,基于GPU高性能计算技术构建了并行优化算法,提高了网络的训练速度,最终构建出了高预测精度的C-LSTM外汇时间序列短期预测方法。然后与不同的神经网络方法在9种不同的外汇货币对数据上进行对比实验分析,实验结果表明,构建的C-LSTM外汇时间序列短期预测方法的预测效果优于其对比方法,充分证明了构建的C-LSTM外汇时间序列短期预测方法在外汇市场分析预测中的有效性和适用性。The prediction method is based on the C-LSTM, which is a combination of CNN and LSTM two deep neural networks. The algorithm analyzes and predicts foreign exchange time series data, and proposes and constructs a C-LSTM foreign exchange time series short-term forecasting method. The three main factors (training samples, network structure, training methods) that affect its prediction accuracy are systematically studied, and feature optimization algorithms are constructed based on the principal component analysis method. The input features are reduced in dimensionality and noise, and then Dropout and The L2 regularization method avoids the over-fitting problem, and further improves the prediction accuracy of the forecast method on foreign exchange data. In order to meet the high timeliness requirements of the foreign exchange market, a parallel optimization algorithm was constructed based on GPU high-performance computing technology to increase the training speed of the network, and finally a C-LSTM foreign exchange time series short-term prediction method with high prediction accuracy was constructed. Then compared with different neural network methods on 9 different foreign exchange currency pair data, the experimental results show that the constructed C-LSTM foreign exchange time series short-term forecasting method is better than the comparison method, which fully proves the construction The effectiveness and applicability of the C-LSTM foreign exchange time series short-term forecasting method in the foreign exchange market analysis and forecasting.
在训练样本方面,针对输入特征,综合考虑影响汇价波动的各种因素,从中提取出4类特征:基本交易数据、技术指标、美元指数和国家经济指标,将这4类特征及其不同组合作为输入特征,同时基于PCA构建输入特征的优化算法,研究得出基本交易数据、技术指标和美元指数组合作为输入变量时的预测精度最高;针对滞后期数,选择不同的滞后期数进行训练,研究发现滞后期数过短,深度学习算法无法完全学习时间序列中的本质规律,会导致精度降低;滞后期数过长,序列中包含的噪声增大,也会影响深度学习算法时间序列本质规律的挖掘,而且训练时间也会大大增加,因此针对不同的问题,选择合适的滞后期数才能取得较好的预测效果。In terms of training samples, according to the input features, comprehensive consideration of various factors affecting exchange rate fluctuations, four types of features are extracted from them: basic transaction data, technical indicators, dollar index, and national economic indicators. These four types of features and their different combinations are taken as Input features, and at the same time, the optimization algorithm of input features is constructed based on PCA. The research shows that the combination of basic transaction data, technical indicators and dollar index as input variables has the highest prediction accuracy; for the number of lag periods, different lag periods are selected for training, research It is found that if the number of lag periods is too short, the deep learning algorithm cannot fully learn the essential laws of the time series, which will lead to a decrease in accuracy; if the number of lag periods is too long, the noise contained in the sequence will increase, which will also affect the essential laws of the time series of the deep learning algorithm. Mining, and the training time will also be greatly increased. Therefore, for different problems, choosing the appropriate number of lag periods can achieve better prediction results.
在网络结构方面,对不同隐藏层层数和每层神经元数量的预测精度进行对比分析,研究发现隐藏层层数和每层的神经元数量过多或者过少都会降低预测精度,隐藏层层数和每层的神经元数量过少,无法完全学习到时间序列中的本质规律,出现欠拟合问题,而当隐藏层层数和每层的神经元数量过多时,会出现过拟合的问题,导致预测精度的下降。不同的深度学习算法结合方式对预测精度也会产生影响,通过实验对比三种不同的结合方式,最终选用先CNN后LSTM的串行结合方式。In terms of network structure, the prediction accuracy of different hidden layer numbers and the number of neurons in each layer was compared and analyzed. The study found that the number of hidden layers and the number of neurons in each layer would reduce the prediction accuracy. If the number and the number of neurons in each layer are too small, it is impossible to fully learn the essential laws in the time series, and the problem of under-fitting occurs. When the number of hidden layers and the number of neurons in each layer is too large, over-fitting will occur. Problems, leading to a decline in prediction accuracy. The combination of different deep learning algorithms will also have an impact on the prediction accuracy. The three different combination methods are compared through experiments, and the serial combination method of CNN first and LSTM is finally selected.
在训练方法方面,分别采用Adam、SGD和RMSProp优化方法对网络训练优化,研究发现Adam和RMSProp这两种优化方法的预测精度相差不大,RMSProp优化方法比Adam优化方法的训练优化过程更加稳定,收敛速度更快,因此RMSProp训练优化效果更好。SGD优化方法相比于另外两种方法,其收敛速度较慢,因此该优化方法的训练优化效果较差。因此,选用RMSProp的优化方法。由于外汇市场对时效性要求较高,交易机会转瞬即逝,使用GPU高性能计算机技术可以有效加速网络的训练速度,有助于提高预测方法在实际应用场景中的可用性。In terms of training methods, the Adam, SGD and RMSProp optimization methods were used to optimize the network training. The study found that the prediction accuracy of the two optimization methods of Adam and RMSProp is not much different. The RMSProp optimization method is more stable than the training optimization process of the Adam optimization method. The convergence speed is faster, so the RMSProp training optimization effect is better. Compared with the other two methods, the SGD optimization method has a slower convergence speed, so the training optimization effect of this optimization method is poor. Therefore, the optimization method of RMSProp is selected. Because the foreign exchange market has high requirements for timeliness and trading opportunities are fleeting, the use of GPU high-performance computer technology can effectively accelerate the training speed of the network and help improve the availability of prediction methods in actual application scenarios.
最后,在9种不同的外汇货币对上与BP、CNN、RNN和LSTM等不同神经网络算法进行对比实验,实验数据表明,基于两种深度神经网络算法相结合构建的C-LSTM外汇时间序列短期预测方法在9种货币对上的预测精度均高于其对比方法,充分证明了构建的C-LSTM外汇时间序列短期预测方法在外汇市场分析预测中的有效性和适用性。Finally, compare experiments with different neural network algorithms such as BP, CNN, RNN and LSTM on 9 different foreign exchange currency pairs. The experimental data show that the short-term C-LSTM foreign exchange time series constructed based on the combination of two deep neural network algorithms The prediction accuracy of the prediction method on the 9 currency pairs is higher than its comparison method, which fully proves the effectiveness and applicability of the constructed C-LSTM foreign exchange time series short-term forecasting method in the analysis and forecasting of the foreign exchange market.
附图说明Description of the drawings
图1为C-LSTM预测方法的网络结构示意图;Figure 1 is a schematic diagram of the network structure of the C-LSTM prediction method;
图2为C-LSTM预测方法训练集结构示意图;Figure 2 is a schematic diagram of the structure of the training set of the C-LSTM prediction method;
图3为tanh、sigmoid和relu激活函数示意图;Figure 3 is a schematic diagram of tanh, sigmoid and relu activation functions;
图4为C-LSTM预测方法训练过程中损失函数值变化情况示意图;Figure 4 is a schematic diagram of the change of the loss function value during the training process of the C-LSTM prediction method;
图5为不同输入特征对均方根误差的影响示意图;Figure 5 is a schematic diagram of the influence of different input features on the root mean square error;
图6为滞后期数n与均方根误差的关系;Figure 6 shows the relationship between the number of lag periods n and the root mean square error;
图7为LSTM隐藏层大小与RMSE之间的关系图;Figure 7 is a diagram of the relationship between the size of the LSTM hidden layer and the RMSE;
图8为RMSE随卷积层大小变化关系图;Figure 8 shows the relationship between RMSE and the size of the convolutional layer;
图9为使用Adam训练优化方法时loss值随迭代次数的变化情况;Figure 9 shows the change of the loss value with the number of iterations when the Adam training optimization method is used;
图10为使用RMSProp训练优化方法时loss值随迭代次数的变化情况;Figure 10 shows the change of loss value with the number of iterations when the RMSProp training optimization method is used;
图11为使用SGD训练优化方法时loss值随迭代次数的变化情况;Figure 11 shows how the loss value changes with the number of iterations when the SGD training optimization method is used;
图12为异步模式的并行优化算法流程图;Figure 12 is a flow chart of the parallel optimization algorithm in asynchronous mode;
图13为同步模式的并行优化算法流程图;Figure 13 is a flow chart of the parallel optimization algorithm in synchronous mode;
图14为训练速度随GPU数量增加的变化趋势图;Figure 14 is a graph showing the change trend of training speed with the increase in the number of GPUs;
图15为C-LSTM预测方法的数据流图;Figure 15 is a data flow diagram of the C-LSTM prediction method;
图16为不同预测方法预测不同货币对时的RMSE值;Figure 16 shows the RMSE value when different forecasting methods predict different currency pairs;
图17为C-LSTM预测方法预测效果拟合图;Figure 17 is a fitting diagram of the prediction effect of the C-LSTM prediction method;
图18为RNN预测方法预测效果拟合图;Figure 18 is a fitting diagram of the prediction effect of the RNN prediction method;
图19为LSTM预测方法预测效果拟合图;Figure 19 is a fitting diagram of the prediction effect of the LSTM prediction method;
图20为CNN预测方法预测效果拟合图;Figure 20 is a fitting diagram of the prediction effect of the CNN prediction method;
图21为预测方法预测效果拟合图。Figure 21 is a fitting diagram of the prediction effect of the prediction method.
具体实施方式Detailed ways
下面结合附图和具体实施例对本发明的具体实施方式做进一步说明:The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings and specific embodiments:
一种外汇时间序列预测方法,包括以下步骤:A foreign exchange time series forecasting method, including the following steps:
步骤1,构建基于卷积神经网络和长短期记忆网络相结合的C-LSTM的预测方法,具体包括: Step 1. Construct a C-LSTM prediction method based on the combination of convolutional neural network and long short-term memory network, which specifically includes:
1-1,构建基于卷积神经网络和长短期记忆网络相结合的C-LSTM的网络模型,具体包括:1-1. Construct a C-LSTM network model based on the combination of convolutional neural network and long short-term memory network, including:
1-1-1,构建包括输入层、隐藏层、输出层、网络训练和网络预测的五个功能模块,结构图如图1所示。1-1-1, construct five functional modules including input layer, hidden layer, output layer, network training and network prediction. The structure diagram is shown in Figure 1.
输入层。首先将经过预处理和归一化的25万个汇率数据以4:1的比例划分为训练集和测试集,训练输入是一段时滞的汇率历史数据和相关特征数据,输出为训练输入滞后一定时间 的预测收盘价,训练集结构如图2所示。图2中,n为滞后期数,从t时刻开始,输入前n个时刻的历史汇率数据和相关特征,对应的训练输出为t时刻一步向前预测值y t+1,根据前n个时刻的历史汇率数据和相关特征,预测下一时刻的外汇收盘价。 Input layer. First, the preprocessed and normalized 250,000 exchange rate data are divided into training set and test set at a ratio of 4:1. The training input is a period of time-lag historical exchange rate data and related feature data, and the output is the training input with a certain lag The predicted closing price of time, the structure of the training set is shown in Figure 2. In Figure 2, n is the number of lag periods. Starting at time t, input the historical exchange rate data and related features of the previous n moments, and the corresponding training output is the one-step forward prediction value y t+1 at time t, according to the previous n moments Based on historical exchange rate data and related characteristics, predict the closing price of foreign exchange at the next moment.
隐藏层。隐藏层的大小即隐藏层中神经元的数目,对算法的学习能力有重要影响。数目过少会导致学习不够充分,数目过多则会导致过拟合。因此在确定隐藏层数和每层神经元数量时,既要保证网络能够学习到训练数据序列的隐含的本质规律,又要防止因网络过于复杂而导致的过拟合问题。Hidden layer. The size of the hidden layer is the number of neurons in the hidden layer, which has an important influence on the learning ability of the algorithm. Too few numbers will lead to insufficient learning, and too many numbers will lead to overfitting. Therefore, when determining the number of hidden layers and the number of neurons in each layer, it is necessary to ensure that the network can learn the hidden essential laws of the training data sequence, but also to prevent the over-fitting problem caused by the network's complexity.
输出层。输出神经元个数是由输出变量数目决定,学术界一致认为,当算法只有一个输出神经元时,输出结果将达到最优。因此输出神经元数目定为1。The output layer. The number of output neurons is determined by the number of output variables. The academic community agrees that when the algorithm has only one output neuron, the output result will be optimal. Therefore, the number of output neurons is set to 1.
网络训练。根据批量梯度下降法,将训练数据集D train按批次划分,每个批次大小为m。然后根据滞后期数n划分数据窗口,输入隐藏层。划分后隐藏层的输入为X={X 1,X 2,…,X n},X经过隐藏层后的输出表示为H={H 1,H 2,…,H n},对应的理论输出为Y,预测输出为
Figure PCTCN2020116955-appb-000013
其中H i=C-LSTM forward(X i,S i-1,P i-1),S i-1和P i-1分别为前一个LSTM循环体的状态和输出,C-LSTM forward为CNN和LSTM循环神经网络的前向计算方法。
Figure PCTCN2020116955-appb-000014
W为输出层的权重矩阵,b为输出层的偏置。
Network training. According to the batch gradient descent method, the training data set D train is divided into batches, and the size of each batch is m. Then divide the data window according to the number of lag periods n, and enter the hidden layer. The input of the hidden layer after division is X={X 1 ,X 2 ,...,X n }, the output of X after the hidden layer is expressed as H={H 1 ,H 2 ,...,H n }, the corresponding theoretical output Is Y, and the predicted output is
Figure PCTCN2020116955-appb-000013
Where H i = C-LSTM forward (X i , S i-1 , P i-1 ), Si -1 and P i-1 are the state and output of the previous LSTM loop body respectively, and C-LSTM forward is CNN And the forward calculation method of LSTM recurrent neural network.
Figure PCTCN2020116955-appb-000014
W is the weight matrix of the output layer, and b is the bias of the output layer.
选用均误差作为损失函数,损失函数定义为
Figure PCTCN2020116955-appb-000015
以损失函数取得最小值为优化目标,给定初始学习率η为0.01,学习率衰减系数α为0.99,训练步数steps以及网络初始化随机数种子seed,隐藏层大小size和隐藏层层数layers。使用RMSProp优化算法不断优化更新网络权重,达到训练步数或者损失函数达到既定阈值时停止网络训练,将训练好的网络存储到硬盘中以供网络预测使用。
The average error is selected as the loss function, and the loss function is defined as
Figure PCTCN2020116955-appb-000015
Taking the minimum value of the loss function as the optimization goal, given the initial learning rate η is 0.01, the learning rate attenuation coefficient α is 0.99, the number of training steps and the network initialization random number seed seed, the size of the hidden layer and the number of layers of the hidden layer. Use RMSProp optimization algorithm to continuously optimize and update network weights, stop network training when the number of training steps is reached or the loss function reaches a predetermined threshold, and store the trained network in the hard disk for network prediction.
网络预测。应用训练好的网络进行预测。采用迭代的方法,预测每个时刻的预测值。预测过程只涉及网络的前向计算过程,与网络训练的前向计算过程类似。将测试集输入训练好的网络中得出预测值,将预测值与真实值计算均方根误差(Root Mean Square Error,RMSE)作为评测网络预测效果的标准,均方根误差越小,预测精度越高。Network forecast. Use the trained network to make predictions. Using an iterative method, predict the predicted value at each moment. The prediction process only involves the forward calculation process of the network, which is similar to the forward calculation process of network training. The test set is input into the trained network to obtain the predicted value, and the root mean square error (RMSE) of the predicted value and the real value is calculated as the standard for evaluating the prediction effect of the network. The smaller the root mean square error, the prediction accuracy Higher.
1-1-2,构建基于卷积神经网络和长短期记忆网络相结合的C-LSTM的外汇时间序列短期预测方法的训练和预测算法;1-1-2, construct training and prediction algorithms for the C-LSTM short-term prediction method of foreign exchange time series based on the combination of convolutional neural network and long short-term memory network;
1-2,选择卷积神经网络和长短期记忆网络的激活函数,选择relu函数作为卷积神经网络和长短期记忆网络的激活函数,网络结构中加入激活函数后,神经网络具有非线性系统的拟合能力。1-2. Select the activation function of the convolutional neural network and the long and short-term memory network, and select the relu function as the activation function of the convolutional neural network and the long and short-term memory network. After the activation function is added to the network structure, the neural network has a nonlinear system Fitting ability.
tanh、sigmoid和relu激活函数示意图如图3所示。当自变量大于0时,relu函数使梯度变化更加稳定,因此算法的训练也更加平稳有效。The schematic diagram of the activation functions of tanh, sigmoid and relu is shown in Figure 3. When the independent variable is greater than 0, the relu function makes the gradient change more stable, so the training of the algorithm is more stable and effective.
1-3,定义卷积神经网络和长短期记忆网络的损失函数,选用均方误差作为损失函数,损 失函数为式(1)所示,1-3, define the loss function of the convolutional neural network and the long short-term memory network, choose the mean square error as the loss function, and the loss function is shown in equation (1),
Figure PCTCN2020116955-appb-000016
Figure PCTCN2020116955-appb-000016
其中,y i为batch中第i个数据所对应的正确答案,
Figure PCTCN2020116955-appb-000017
为第i个数据所对应的神经网络预测值。均方误差将误差进行放大,可以较好的衡量预测误差的细微差别,是预测数据与实际数据之间差异的一个重要信号。损失函数值随训练迭代次数增加的变化趋势如图4所示,由图4可知,预测方法在训练过程中,随着迭代次数的增加,损失函数值在快速稳定减小,说明预测方法训练效果较好。
Among them, y i is the correct answer corresponding to the i-th data in the batch,
Figure PCTCN2020116955-appb-000017
Is the predicted value of the neural network corresponding to the i-th data. The mean square error amplifies the error, which can better measure the subtle difference of the forecast error, and is an important signal of the difference between the forecast data and the actual data. The change trend of the loss function value with the increase of the number of training iterations is shown in Figure 4. It can be seen from Figure 4 that during the training process of the prediction method, as the number of iterations increases, the loss function value decreases rapidly and steadily, indicating the training effect of the prediction method better.
1-4,选择交易类指标和基本面数据作为卷积神经网络和长短期记忆网络的输入特征。外汇汇率当日的开盘价、最高价、最低价和收盘价是当前市场情况的最好最直接的反映。1-4. Select trading indicators and fundamental data as the input features of the convolutional neural network and the long- and short-term memory network. The opening price, highest price, lowest price and closing price of the foreign exchange rate on the day are the best and most direct reflection of current market conditions.
技术指标通过基本交易数据计算得来,主要用来辅助判断汇价变动的趋势,常用的技术指标主要有以下几种:MA(移动平均线)和MACD(平滑异同移动平均线)等趋势型指标主要用于反映当前汇价变动的趋势,是上升趋势还是下降趋势或者震荡趋势。另一类则是反趋势指标,或者说超买超卖型指标,主要用来判断趋势的转折点,该类指标常用的有KDJ(随机指标)、BIAS(乖离率)、RSI(相对强弱指标)和ROC(价格变动率)等。在汇市整体行情方面,用美元指数代表整个市场的情况,这是因为该指数代表汇市主流货币对的波动状况。Technical indicators are calculated through basic transaction data and are mainly used to assist in judging the trend of exchange rate changes. Commonly used technical indicators mainly include the following: MA (moving average) and MACD (moving average of similarities and differences) and other trend indicators. It is used to reflect the current trend of exchange rate changes, whether it is an upward trend, a downward trend, or a shock trend. The other type is counter-trend indicators, or overbought and oversold indicators, which are mainly used to determine the turning point of the trend. The commonly used indicators of this type are KDJ (stochastic index), BIAS (rate of deviation), and RSI (relative strength indicator). ) And ROC (rate of price change), etc. In terms of the overall market situation of the foreign exchange market, the US dollar index is used to represent the situation of the entire market because the index represents the volatility of mainstream currency pairs in the foreign exchange market.
通过交易类指标计算得出技术指标,常用的技术指标包括移动平行线和平滑异同移动平行线,移动平行线和平滑异同移动平行线用于反映当前汇价变动的趋势,通过反趋势指标判断趋势转折点,反趋势指标包括随机指标、乖离率、相对强弱指标和价格变动率。Technical indicators are calculated through trading indicators. Commonly used technical indicators include moving parallel lines and smooth similarities and differences moving parallel lines. Moving parallel lines and smoothing similarities and differences moving parallel lines are used to reflect the current trend of exchange rate changes, and use counter-trend indicators to determine trend turning points. , Counter-trend indicators include stochastic indicators, deviation rates, relative strength indicators and price changes.
移动平行线标是计算某段时期内汇率收盘价的平均值,以该平均值作为判断趋势变化的依据,具体计算公式如式(2)所示,The moving parallel line mark is to calculate the average value of the closing price of the exchange rate in a certain period of time. The average value is used as the basis for judging the trend change. The specific calculation formula is shown in formula (2).
Figure PCTCN2020116955-appb-000018
Figure PCTCN2020116955-appb-000018
其中,N代表时间周期,close代表收盘价;Among them, N represents the time period, and close represents the closing price;
选取快速移动平均线和慢速移动平均线,再求出DIF的平滑移动平均线DEA,最后得出平滑异同移动平均线,具体计算如式(3)-(7)所示,Select the fast moving average and the slow moving average, and then calculate the DIF smooth moving average DEA, and finally get the smooth similarity and difference moving average. The specific calculation is shown in formulas (3)-(7).
Figure PCTCN2020116955-appb-000019
Figure PCTCN2020116955-appb-000019
Figure PCTCN2020116955-appb-000020
Figure PCTCN2020116955-appb-000020
Figure PCTCN2020116955-appb-000021
Figure PCTCN2020116955-appb-000021
Figure PCTCN2020116955-appb-000022
Figure PCTCN2020116955-appb-000022
BAR=2×(DIF-DEA)                         (7)BAR=2×(DIF-DEA) (7)
在式(3)-(7)中,EMA -1为前一日的指数移动平均值,Close为今日收盘价,BAR即为MACD柱状图的高度值。 In formulas (3)-(7), EMA -1 is the exponential moving average of the previous day, Close is today's closing price, and BAR is the height of the MACD histogram.
随机指标的具体计算式如式(8)-(11)所示,The specific calculation formula of the stochastic index is shown in formulas (8)-(11),
RSV N=(Close (N)-Low (N))÷(High (N)-Low (N))×100%         (8) RSV N = (Close (N) -Low (N) )÷(High (N) -Low (N) )×100% (8)
Figure PCTCN2020116955-appb-000023
Figure PCTCN2020116955-appb-000023
Figure PCTCN2020116955-appb-000024
Figure PCTCN2020116955-appb-000024
J=3×K-2×D                    (11)J=3×K-2×D (11)
其中,Close (N)为N日内收盘价平均值,Low (N)为N日内的最低价,High (N)为N日内的最高价,K -1为前一日K值,D -1为前一日D值,根据KDJ的不同取值,可以将其划分为超买、超卖和震荡区。一般的划分标准为:当KDJ值在80以上为超买区,可以考虑进行卖出操作;KDJ值在20以下为超卖区,可以考虑进行买入操作;当KDJ值在20-80之间时为震荡区,应继续观望,不宜交易。 Among them, Close (N) is the average closing price in N days, Low (N) is the lowest price in N days, High (N) is the highest price in N days, K -1 is the K value of the previous day, and D -1 is The D value of the previous day can be divided into overbought, oversold and shock zones according to the different values of KDJ. The general classification standard is: when the KDJ value is above 80, it is considered as an overbought zone; when the KDJ value is below 20, it is considered as an oversold zone, and you can consider buying; when the KDJ value is between 20-80 It is a shock zone at times, and should continue to wait and see, and it is not suitable to trade.
乖离率的具体计算式如式(12),The specific calculation formula of the deviation rate is as formula (12),
Figure PCTCN2020116955-appb-000025
Figure PCTCN2020116955-appb-000025
其中,Close为当日收盘价,N为时间周期,取值为12;Among them, Close is the closing price of the day, N is the time period, and the value is 12;
相对强弱指标的计算式如式(13),The calculation formula of the relative strength index is as formula (13),
Figure PCTCN2020116955-appb-000026
Figure PCTCN2020116955-appb-000026
其中,Rise i是第i日收盘价涨幅,Fall i是第i日收盘价跌幅;价格变动率的计算公式为式(14), Among them, Rise i is the increase in the closing price on the i day, and Fall i is the decrease in the closing price on the i day; the formula for calculating the rate of price change is equation (14),
ROC=Close÷Close -N                  (14) ROC=Close÷Close -N (14)
其中,Close是当日收盘价,Close -N前N日的收盘价。 Among them, Close is the closing price of the day, and Close -N is the closing price of the previous N days.
综上所述,交易类指标汇总如表1所示,In summary, the transaction indicators are summarized as shown in Table 1.
表1Table 1
Figure PCTCN2020116955-appb-000027
Figure PCTCN2020116955-appb-000027
经济类指标Economic indicators
利率interest rate
利率是指一定时期内利息额与借贷资金额即本金的比率。企业的资金成本高低主要受利率的影响,同时利率还决定着企业的筹资、投资,利率的现况以及变化发展动向务必被关注在金融市场的研究中。是指借款、存入或借入金额(称为本金总额)中每个期间到期的利息金额与票面价值的比率。Interest rate refers to the ratio of the amount of interest to the amount of borrowed funds or principal during a certain period of time. The level of capital cost of an enterprise is mainly affected by interest rates. At the same time, interest rates also determine the financing and investment of enterprises. The current status of interest rates and changes and development trends must be paid attention to in the study of financial markets. Refers to the ratio of the amount of interest due during each period in the amount of borrowing, deposit or borrowing (referred to as the total principal) to the face value.
本金总额、利率、复利频率以及借出、存入或借入的时间长度等因素决定借出或借入资金的所有利息总和。利率是借款人向所借本金或提前消费付出的报酬,需向其所借金钱所支付的代价,也是放款人推迟消费将资金借给借款人收到的酬报。利率一般指一年期获得的利息占本金的百分比。Factors such as the total principal amount, interest rate, frequency of compound interest, and length of time for lending, depositing or borrowing determine the sum of all interest on the loaned or borrowed funds. The interest rate is the remuneration that the borrower pays for the principal borrowed or consumption in advance, and the price to be paid for the money borrowed. It is also the remuneration received by the lender for deferring consumption and lending funds to the borrower. Interest rate generally refers to the percentage of interest earned over a one-year period to the principal.
GDPGDP
GDP(国内生产总值):指一个国家(或地区)在一定时期内,在其境内生产出的全部最终产品和劳务市场价值的总和,是衡量一个国家(或地区)综合实力、衡量国家(或地区)经济发展状况的重要指标,是国民经济核算的核心指标,GDP不能用于衡量一个地区或城市的经济状况,根据国家或上级单位对不同城市每年需要征收的量有差异性,所以每个城市所剩余的财富也不相同。GDP (Gross Domestic Product): refers to the total market value of all final products and labor produced in a country (or region) within a certain period of time. It is a measure of the comprehensive strength of a country (or region) and a country ( (Or region) an important indicator of economic development status is the core indicator of national economic accounting. GDP cannot be used to measure the economic status of a region or city. According to the state or higher-level unit, the amount that needs to be levied in different cities each year is different, so each The remaining wealth in each city is also different.
步骤2,从输入特征、网络结构和训练方法三个方面对步骤1构建的方法进行训练优化,训练优化项目包括主成分分析的特征优化、卷积神经网络和长短期记忆网络滞后期数优化、 卷积神经网络和长短期记忆网络网络结构优化、卷积神经网络和长短期记忆网络训练方法优化、基于GPU的并行优化; Step 2. Train and optimize the method constructed in Step 1 from the three aspects of input features, network structure and training methods. The training optimization items include feature optimization of principal component analysis, convolutional neural network and long and short-term memory network lag period optimization, Convolutional neural network and long short-term memory network structure optimization, convolutional neural network and long short-term memory network training method optimization, GPU-based parallel optimization;
输入特征方面,选取18个指标数据作为输入特征,18个指标数据分为四大类:基本交易数据、技术指标数据、美元指数和国家经济指标,将这四类指标进行组合,并基于主成分分析法进行输入特征的优化,研究不同指标对预测精度的影响并选取最佳的输入特征,然后实验研究滞后期数对预测精度的影响,从而选择最佳的滞后期数;In terms of input features, 18 indicator data are selected as input features. The 18 indicator data are divided into four categories: basic transaction data, technical indicator data, dollar index and national economic indicators. These four types of indicators are combined and based on principal components. The analysis method optimizes the input features, studies the impact of different indicators on the prediction accuracy and selects the best input features, and then experimentally studies the impact of the number of lag periods on the prediction accuracy, so as to select the best number of lag periods;
网络结构方面,根据网格搜索算法研究最佳的隐藏层结构大小,通过改变不同的卷积神经网络和长短期记忆网络的结合方式,研究不同的算法结合方式对预测精度的影响,选择最佳的隐藏层大小和算法结合方式;In terms of network structure, according to the grid search algorithm to study the best hidden layer structure size, by changing the combination of different convolutional neural networks and long and short-term memory networks, to study the impact of different algorithm combinations on the prediction accuracy, and choose the best The hidden layer size and algorithm combination method;
训练方法方面,采用Adam、SGD以及RMSProp方法进行网络的训练,通过对比训练后的算法预测精度以及在训练过程中,损失函数随迭代次数的变化情况和收敛速度,研究不同的训练方法对训练效果和预测精度的影响,最终选择使用RMSProp训练优化方法,RMSProp训练优化方法收敛速度快,训练过程最稳定,训练优化效果最好。In terms of training methods, the Adam, SGD, and RMSProp methods are used to train the network. By comparing the prediction accuracy of the training algorithm and the change of the loss function with the number of iterations and the convergence speed during the training process, the effect of different training methods on the training is studied. And the impact of prediction accuracy, the RMSProp training optimization method was finally chosen. The RMSProp training optimization method has a fast convergence speed, the most stable training process, and the best training optimization effect.
基于PCA构建特征优化算法,对输入特征进行降维除燥,PCA(Principal Components Analysis,主成分分析)是降维中最经典的方法,它是一种线性、非监督、全局的降维算法,旨在找到数据中的主成分,并利用这些主成分表示原始数据特征,从而达到降维的目的。Construct a feature optimization algorithm based on PCA, and perform dimensionality reduction on input features. PCA (Principal Components Analysis) is the most classic method of dimensionality reduction. It is a linear, unsupervised, and global dimensionality reduction algorithm. The aim is to find the principal components in the data, and use these principal components to represent the features of the original data, so as to achieve the purpose of dimensionality reduction.
PCA的主要思想是将n维输入特征向量映射到k维上,这k维特征向量是全新的正交特征(即主成分),是在原有n维特征的基础上重新构造出来的k维特征。PCA的主要工作就是从原始输入数据的特征空间中顺序地找一组相互正交的坐标轴,第一个新坐标轴是根据原始数据中方差最大的方向选择的,第二个新坐标轴选择是与第一个坐标轴正交的平面中使得方差最大的,第三个轴是与前两个坐标轴轴正交的平面中方差最大的。依次类推,可以得到n个这样的坐标轴。The main idea of PCA is to map the n-dimensional input feature vector to k-dimensional. This k-dimensional feature vector is a brand new orthogonal feature (ie principal component), which is a k-dimensional feature reconstructed on the basis of the original n-dimensional feature. . The main job of PCA is to sequentially find a set of mutually orthogonal coordinate axes from the feature space of the original input data. The first new coordinate axis is selected according to the direction with the largest variance in the original data, and the second new coordinate axis is selected. It is the plane orthogonal to the first coordinate axis that maximizes the variance, and the third axis is the plane orthogonal to the first two coordinate axes that has the largest variance. By analogy, n such coordinate axes can be obtained.
大部分方差都包含在前面k个坐标轴中,后面的坐标轴所含的方差值非常小,因此,我们可以只保留前面k个含有绝大部分方差的坐标轴,这相当于只保留包含绝大部分方差的维度特征,从而在保留数据大部分特征的前提下,实现对原始输入数据的特征降维。Most of the variances are contained in the first k coordinate axes, and the following coordinate axes contain very small variance values. Therefore, we can only keep the first k coordinate axes that contain most of the variance, which is equivalent to keeping only the Most of the dimensional characteristics of the variance, so as to achieve the dimensionality reduction of the original input data under the premise of preserving most of the characteristics of the data.
研究问题时,我们经常引入多个自变量,这多自变量组合成比较高维的特征向量,这些向量所处的高维空间中,常常包含很多信息冗余和噪声,而且输入变量的维度的过高会增加问题的复杂性。因此,我们希望在保留主要信息的前提下尽可能降低输入变量的维度,从而提升特征表达能力,降低训练的复杂度。When researching problems, we often introduce multiple independent variables, which are combined into relatively high-dimensional feature vectors. The high-dimensional space in which these vectors are located often contains a lot of information redundancy and noise, and the dimensionality of the input variables is different. Too high will increase the complexity of the problem. Therefore, we hope to reduce the dimensionality of input variables as much as possible while preserving the main information, so as to improve the feature expression ability and reduce the complexity of training.
该方法总共选取4类指标数据,一类为与外汇交易直接相关的基本交易数据,一类为由交易数据计算出来的技术指标数据,一类为与汇市整体情况相关的美元指数,一类为反映国家经济状况的国家经济指标。这4类指标数据内部有可能存在相关性,而且过多的输入也会影响深度学习算的法收敛速度和泛化能力,因此基于主成分分析法对输入指标进行降维。在降维的同时,除去了数据中的部分噪声数据。This method selects a total of 4 types of indicator data, one is basic transaction data directly related to foreign exchange transactions, the other is technical indicator data calculated from transaction data, the other is the US dollar index related to the overall situation of the foreign exchange market, and the other is National economic indicators that reflect the state of the country's economy. These four types of index data may have internal correlations, and too much input will also affect the convergence speed and generalization ability of the deep learning algorithm. Therefore, the input index is reduced based on the principal component analysis method. While reducing the dimensionality, part of the noise data in the data is removed.
基于PCA构建特征优化算法步骤具体为:The specific steps of constructing feature optimization algorithm based on PCA are as follows:
对输入的n维特征矩阵D进行中心化处理,即每列数据均减去该列均值μ;Perform centralization processing on the input n-dimensional feature matrix D, that is, each column of data is subtracted from the column mean μ;
计算中心化后的输入特征矩阵的协方差矩阵S;Calculate the covariance matrix S of the input feature matrix after centering;
对计算出的协方差矩阵的特征值λ及其对应的特征向量ω,并将特征值从大到小排序λ 12,…,λ nFor the calculated eigenvalue λ of the covariance matrix and its corresponding eigenvector ω, and sort the eigenvalues from large to small λ 1 , λ 2 ,..., λ n ;
取前k大特征值λ 12,…,λ k对应的特征向量ω 12,…,ω k,通过式(15)将n维特征映射到k维 Take the eigenvectors ω 1 , ω 2 ,..., ω k corresponding to the first k large eigenvalues λ 1 , λ 2 ,..., λ k , and map the n-dimensional features to k-dimensional through equation (15)
Figure PCTCN2020116955-appb-000028
Figure PCTCN2020116955-appb-000028
新的x′ i的第k维就是x i在第k个主成分ω k方向上的投影,通过选取最大的k个特征值对应的特征向量,我们将方差较小的特征丢弃,使得每个n维列向量被映射为k维列向量x′ i,得到k维的特征矩阵D′。 The k- th dimension of the new x′ i is the projection of x i in the direction of the k-th principal component ω k . By selecting the eigenvectors corresponding to the largest k eigenvalues, we discard the features with the smaller variance, so that each The n-dimensional column vector is mapped to the k-dimensional column vector x′ i , and the k-dimensional feature matrix D′ is obtained.
影响汇价变动的因素众多,该方法将影响因素主要分为四类:基本交易数据、技术指标数据、美元指数和国家经济指标。基于PCA降维算法,将四类影响因素建立以下6种对比方法,通过实验研究来选取降维除噪后的最佳输入特征组合。表2分析了输入特征对预测精度的影响。There are many factors that affect exchange rate changes. This method mainly divides the influencing factors into four categories: basic transaction data, technical indicator data, dollar index, and national economic indicators. Based on the PCA dimensionality reduction algorithm, the following six comparison methods are established for the four types of influencing factors, and the best input feature combination after dimensionality reduction and denoising is selected through experimental research. Table 2 analyzes the impact of input features on prediction accuracy.
表2Table 2
Figure PCTCN2020116955-appb-000029
Figure PCTCN2020116955-appb-000029
从图5中可以直观看出,第4种输入特征组合得到的均方根误差最小,预测精度最高。第3种输入特征组合次之,说明美元指数对该汇价具有大的影响。第1种输入特征组合的均方根误差仅略高于第3种,说明基于基本交易数据计算得出的指标数据还有较多冗余信息,对于汇价的分析预测价值不大。第6种输入特征组合的均方根误差最高,说明仅使用美元指数和国家经济指标无法对汇价进行较好的预测,第7种输入特征组合的均方根误差高于第1、3、4种输入特征组合,说明使用所有四类输入特征,训练样本的噪声增加,冗余信息增多,不利于对于汇价的分析预测。It can be seen intuitively from Figure 5 that the root mean square error obtained by the fourth input feature combination is the smallest and the prediction accuracy is the highest. The third input feature combination comes next, indicating that the US dollar index has a large impact on the exchange rate. The root mean square error of the first type of input feature combination is only slightly higher than that of the third type, indicating that the index data calculated based on the basic transaction data has more redundant information, which is of little value for the analysis and prediction of the exchange rate. The root mean square error of the sixth input feature combination is the highest, indicating that only the US dollar index and national economic indicators cannot be used to predict the exchange rate better. The root mean square error of the seventh input feature combination is higher than that of the first, third, and fourth input feature combinations. This combination of input features shows that the use of all four types of input features will increase the noise of training samples and increase redundant information, which is not conducive to the analysis and prediction of exchange rates.
综上,对外汇预测影响最大的输入特征是基本交易数据,通过基本交易数据计算得出技术指标时,信息有所损失。当输入数据维度较少时,适当增加有效的信息可以提高预测精度,但是增加的信息冗余,噪声大,反而会影响预测效果,因此针对具体问题要选择合适的输入特征,输入特征过少,容易导致欠拟合,输入特征过多,会使数据的噪声增加,反而降低了学习效果和训练速率。因此,选择第4种输入特征组合:基本交易数据、技术指标和美元指数作为最佳输入特征组合。In summary, the input feature that has the greatest impact on foreign exchange forecasts is basic transaction data. When technical indicators are calculated through basic transaction data, information is lost. When the input data dimension is small, appropriately increasing the effective information can improve the prediction accuracy, but the increased information redundancy and noise will affect the prediction effect. Therefore, it is necessary to select appropriate input features for specific problems, and there are too few input features. It is easy to lead to under-fitting. Too many input features will increase the noise of the data, which will reduce the learning effect and training rate. Therefore, the fourth input feature combination is selected: basic transaction data, technical indicators and dollar index as the best input feature combination.
滞后期数n是指分析预测的时间序列长度,即用前n天的数据对第n+1天进行预测。滞后期数的不同可能会对预测精度产生重要的影响。在4.1节优化的基础上,选取5、10、20、30、40、50、60不同的滞后期数,研究滞后期数n对预测精度的影响,以选取最佳的滞后期数n。详细实验室数据如表3所示,将表3的数据可视化得到图6.The number of lag periods n refers to the length of the analysis and prediction time series, that is, the n+1 day is predicted using the data of the previous n days. The difference in the number of lag periods may have an important impact on forecast accuracy. Based on the optimization in Section 4.1, choose 5, 10, 20, 30, 40, 50, 60 different lag periods, study the influence of the lag period n on the prediction accuracy, and select the best lag period n. The detailed laboratory data is shown in Table 3, and the data in Table 3 is visualized to get Figure 6.
表3table 3
Figure PCTCN2020116955-appb-000030
Figure PCTCN2020116955-appb-000030
图6可以明显看出,随着滞后期数的增加,均方根误差先减小后增大,当滞后期数为30时预测精度最高。说明当滞后期数小于30时,序列长度过短,无法充分反映序列的变化情况,算法无法学习到训练样本中的本质规律,当滞后期数大于30时,序列长度过长,序列中包含了较多的噪声数据,影响了算法的学习训练,说明离预测值较远的数据,对其影响较小。因此将滞后期数设置为30。Figure 6 clearly shows that as the number of lag periods increases, the root mean square error first decreases and then increases. When the number of lag periods is 30, the prediction accuracy is the highest. It shows that when the number of lag periods is less than 30, the sequence length is too short to fully reflect the changes in the sequence, and the algorithm cannot learn the essential laws in the training samples. When the number of lag periods is greater than 30, the sequence length is too long and the sequence contains More noise data affects the learning and training of the algorithm, indicating that the data far away from the predicted value has less impact on it. Therefore, the number of lag periods is set to 30.
深度学习算法的网络结构对预测精度有重要的影响,由于输入神经元数量和输出神经元数量由问题本身决定,因此网络结构的选择就是指隐藏层大小的选择。由4.1节可知,最佳输入特征为12维,因此输入神经元个数为12,由于的预测结果是一个数值,因此输出神经元的数量为1。隐藏层的大小包括卷积层层数,卷积核大小,卷积核个数,循环层层数和循环层大小。The network structure of the deep learning algorithm has an important influence on the prediction accuracy. Since the number of input neurons and the number of output neurons are determined by the problem itself, the choice of the network structure refers to the choice of the size of the hidden layer. It can be seen from Section 4.1 that the best input feature is 12 dimensions, so the number of input neurons is 12, and because the predicted result is a numerical value, the number of output neurons is 1. The size of the hidden layer includes the number of convolutional layers, the size of the convolution kernel, the number of convolution kernels, the number of recurrent layers, and the size of recurrent layers.
先将卷积层层数、卷积核大小和个数均设置为1,先实验研究LSTM循环层的大小取值对预测精度的影响,以选定最优的循环层的大小取值。设置隐藏层层数分别为1,2,3,4,5,每层神经元数量设置为8,16,32,64,128,256,详细实验数据如表4所示。First, set the number of convolutional layers, the size and number of convolution kernels to 1, and first experimentally study the influence of the size of the LSTM loop layer on the prediction accuracy, and select the optimal loop layer size. Set the number of hidden layers to 1, 2, 3, 4, and 5, and set the number of neurons in each layer to 8, 16, 32, 64, 128, and 256. The detailed experimental data is shown in Table 4.
表4Table 4
Figure PCTCN2020116955-appb-000031
Figure PCTCN2020116955-appb-000031
将表4可视化得到图7,由图7可以直观看出,均方根误差RMSE随着神经元个数的增 加和隐藏层层数的增大而减少,但当增加到一定量时,RMSE不降反增,此时网络结构过大,神经元数量过大,出现过拟合的现象。当神经元数量过少时,RMSE较大,是由于网络规模过小,无法有效拟合训练数据,出现欠拟合的问题。因此神经元的数量过多过少都会降低预测精度,针对不同的问题,需要设置合适的网络规模,因此将LSTM隐藏层层数设置为3,每层神经元数量为128个。Visualize Table 4 to get Figure 7. From Figure 7, it can be seen directly that the root mean square error RMSE decreases with the increase of the number of neurons and the number of hidden layers, but when it increases to a certain amount, the RMSE does not Decrease but increase. At this time, the network structure is too large and the number of neurons is too large, and the phenomenon of over-fitting occurs. When the number of neurons is too small, the RMSE is larger, because the network scale is too small to effectively fit the training data, and the problem of underfitting occurs. Therefore, too many neurons will reduce the prediction accuracy. For different problems, it is necessary to set an appropriate network scale. Therefore, the number of LSTM hidden layers is set to 3, and the number of neurons in each layer is 128.
选择好循环层大小后,继续实验研究卷积层大小对预测精度的影响。设置卷积层层数分别为1,2,3,4,5,卷积核大小分别为1×1,3×3,5×5,7×7,卷积核个数和卷积滑动步长均设置为1,以保证卷积层的输出维度与输入维度保持一致。具体实验结果如表5所示,表5可视化得到图8所示。After choosing the size of the loop layer, continue to experiment to study the effect of the size of the convolution layer on the prediction accuracy. Set the number of convolutional layers to 1, 2, 3, 4, 5, the size of the convolution kernels are 1×1, 3×3, 5×5, 7×7, the number of convolution kernels and the convolution sliding step The length is set to 1 to ensure that the output dimension of the convolutional layer is consistent with the input dimension. The specific experimental results are shown in Table 5, and Table 5 is visualized as shown in Figure 8.
表5table 5
Figure PCTCN2020116955-appb-000032
Figure PCTCN2020116955-appb-000032
由图8可以直观看出,当卷积层层数为2,卷积核大小为3×3时,RMSE值最小,预测精度最高。当卷积层层数为1时,对数据的抽象程度不够,数据还存在较多噪声,当卷积层层数大于2时,对数据过于抽象,损失了数据的原有特征,因此抽象不够或者过度抽象都会降低算法的预测精度。当卷积核为1×1时,仅对数据做了非线性的变化,但是没有抽象出数据周围的空间特征,而当卷积核大于3×3时,对数据周围的空间特征采集过多,反而影响了预测精度,这说明离数据较远的位置与当前数据的关联性较小。综上所述,当卷积层层数为2,卷积和大小为3×3时,较好的抽象了数据的空间特征,因此将卷积层层数定为2,卷积核大小定为3×3。It can be seen intuitively from Fig. 8 that when the number of convolutional layers is 2 and the size of the convolution kernel is 3×3, the RMSE value is the smallest and the prediction accuracy is the highest. When the number of convolutional layers is 1, the degree of abstraction of the data is not enough, and the data still has a lot of noise. When the number of convolutional layers is greater than 2, the data is too abstract and the original features of the data are lost, so the abstraction is not enough Or excessive abstraction will reduce the prediction accuracy of the algorithm. When the convolution kernel is 1×1, only nonlinear changes are made to the data, but the spatial features around the data are not abstracted, and when the convolution kernel is larger than 3×3, the spatial features around the data are collected too much , On the contrary, it affects the prediction accuracy, which shows that the location far away from the data has less correlation with the current data. In summary, when the number of convolutional layers is 2 and the convolution sum size is 3×3, the spatial characteristics of the data are better abstracted. Therefore, the number of convolutional layers is set to 2, and the size of the convolution kernel is set. It is 3×3.
卷积神经网络和长短期记忆网络网络结构优化包括以下部分:The network structure optimization of convolutional neural network and long short-term memory network includes the following parts:
长短期记忆网络循环层超参数优化;Hyperparameter optimization of cyclic layer of long-short-term memory network;
卷积层超参数优化;Convolutional layer hyperparameter optimization;
算法结合方式优化,卷积神经网络和长短期记忆网络的结合方式包括:The algorithm combination method is optimized. The combination method of convolutional neural network and long short-term memory network includes:
先卷积神经网络后长短期记忆网络,卷积神经网络层的输出作为长短期记忆网络层的输入;The convolutional neural network is first followed by the long and short-term memory network, and the output of the convolutional neural network layer is used as the input of the long and short-term memory network layer;
先长短期记忆网络后卷积神经网络,长短期记忆网络层的输出作为卷积神经网络层的输入;The long-short-term memory network is first followed by the convolutional neural network, and the output of the long-short-term memory network layer is used as the input of the convolutional neural network layer;
卷积神经网络后长短期记忆网络分别进行,结合两种算法的输出做最终的预测。After the convolutional neural network, the long and short-term memory network is performed separately, and the output of the two algorithms is combined to make the final prediction.
在选定上述超参数的基础上,分别使用这三种不同的结合方法进行实验研究。实验结果表明,第(1)种算法结合方式的预测精度最高,因此使用先CNN后LSTM的串行结合方式。深度学习算法的迭代训练的方法一直是研究的重点问题,训练方法的效果会直接影响到预测的精度。其中,解决训练优化问题最常用的方法就是基于梯度下降的方法,其重点是如何用最少的训练次数使训练效果最优,并同时防止过拟合问题的出现。对Adam、SGD和RMSProp三种训练优化方法进行对比分析,根据实验结果选择最优的训练方法。实验结果如表6所示。由表6可知,使用SGD优化方法后,预测精度均低于另外两种优化方法,RMSProp优化方法与Adam优化方法对预测精度的影响相当。On the basis of selecting the above-mentioned hyperparameters, these three different combination methods were used for experimental research. The experimental results show that the (1) algorithm combination method has the highest prediction accuracy, so the serial combination method of CNN first and LSTM is used. The iterative training method of deep learning algorithms has always been a key issue of research, and the effect of the training method will directly affect the accuracy of the prediction. Among them, the most commonly used method to solve the training optimization problem is the method based on gradient descent, which focuses on how to optimize the training effect with the least number of training times, and at the same time prevent the occurrence of over-fitting problems. The three training optimization methods of Adam, SGD and RMSProp were compared and analyzed, and the best training method was selected according to the experimental results. The experimental results are shown in Table 6. It can be seen from Table 6 that after using the SGD optimization method, the prediction accuracy is lower than the other two optimization methods. The RMSProp optimization method and the Adam optimization method have the same impact on the prediction accuracy.
表6Table 6
Figure PCTCN2020116955-appb-000033
Figure PCTCN2020116955-appb-000033
由图9-11可以看出,Adam优化方法训练过程不稳定,loss值随着迭代次数的增加出现了明显震荡。RMSProp优化方法收敛速度比Adam优化方法快,而且训练过程稳定,loss值随着迭代次数的增加稳步下降,训练优化效果较好。SGD优化方法收敛速度较慢,且训练过程中loss值出现了震荡,训练效果不如RMSProp的训练效果好。It can be seen from Figure 9-11 that the training process of the Adam optimization method is unstable, and the loss value fluctuates significantly as the number of iterations increases. The RMSProp optimization method has a faster convergence rate than the Adam optimization method, and the training process is stable. The loss value steadily decreases as the number of iterations increases, and the training optimization effect is better. The SGD optimization method converges slowly, and the loss value fluctuates during the training process, and the training effect is not as good as that of RMSProp.
综上所述,RMSProp训练优化方法收敛速度快,训练过程最稳定,训练优化效果最好,In summary, the RMSProp training optimization method converges fast, the training process is the most stable, and the training optimization effect is the best.
因此选择使用RMSProp训练优化方法。So choose to use RMSProp training optimization method.
金融市场对时效性要求较高,深度学习算法训练所需计算量大,耗时较多,难以满足金融市场的高时效性需要,因此需要使用GPU高性能计算技术进行训练过程的并行优化。使用多个GPU进行训练过程的加速,有效提高了训练速度,进一步提升了预测方法在外汇市场中的可用性。The financial market has high requirements for timeliness, and deep learning algorithm training requires a large amount of calculation and time-consuming, and it is difficult to meet the high timeliness needs of the financial market. Therefore, it is necessary to use GPU high-performance computing technology for parallel optimization of the training process. The use of multiple GPUs to accelerate the training process effectively improves the training speed and further enhances the usability of the prediction method in the foreign exchange market.
深度学习模型是一个迭代过程,为更快的训练模型,选用常用的并行化深度学习模型训练方法对模型进行训练。为保证模型在实际应用中的时效性,因此,需使用多GPU并行加速模型的训练过程。The deep learning model is an iterative process. In order to train the model faster, common parallel deep learning model training methods are used to train the model. In order to ensure the timeliness of the model in practical applications, it is necessary to use multiple GPUs to accelerate the training process of the model in parallel.
每次迭代中,根据当前参数的取值,利用前向传播算法算出一部分训练数据集上的预测值,根据预测值跟真实值的差,然后反向传播算法根据损失函数计算出参数梯度后对参数进行更新。并行化深度学习模型方法有两种:同步并行模式与异步并行模式。In each iteration, according to the value of the current parameter, the forward propagation algorithm is used to calculate the predicted value on a part of the training data set. According to the difference between the predicted value and the real value, the back propagation algorithm calculates the parameter gradient according to the loss function. The parameters are updated. There are two ways to parallelize deep learning models: synchronous parallel mode and asynchronous parallel mode.
异步训练模式流程图如图12,可以看出,异步并行模式算法在每一次迭代时,不同设备读取最新参数,然后获取一小部分训练数据进行训练,独立运行反向传播过程并独自更新参数。The flowchart of the asynchronous training mode is shown in Figure 12. It can be seen that in each iteration of the asynchronous parallel mode algorithm, different devices read the latest parameters, and then obtain a small part of the training data for training, run the backpropagation process independently and update the parameters independently .
同步并行模式与异步并行模式算法区别在于同步并行模式算法流程中所有设备获取同一个参数,如下图13所示,根据图13可以看出,同步并行模式算法在每一次迭代时,不同设备读取相同参数,反向传播算法后,取参数更新梯度的平均值更新参数,最后统一更新参数。两种方式算法的训练过程。The difference between the synchronous parallel mode and the asynchronous parallel mode algorithm is that all devices in the synchronous parallel mode algorithm process obtain the same parameter, as shown in Figure 13 below. According to Figure 13, it can be seen that the synchronous parallel mode algorithm is read by different devices in each iteration. For the same parameters, after the back-propagation algorithm, take the average value of the parameter update gradient to update the parameters, and finally update the parameters uniformly. The training process of the algorithm in two ways.
基于GPU的同步模式并行训练优化算法描述如下。n为GPU的个数,D train为训练数据集,batch-size为每个批次的训练数据集大小,将不同批次的数据集同时分发到不同GPU上进行训练,计算得出不同GPU上的梯度值
Figure PCTCN2020116955-appb-000034
然后计算所有GPU上的梯度平均值得到
Figure PCTCN2020116955-appb-000035
使用
Figure PCTCN2020116955-appb-000036
作为本次训练的梯度更新量。
The GPU-based synchronization mode parallel training optimization algorithm is described as follows. n is the number of GPUs, D train is the training data set, batch-size is the size of the training data set of each batch, the data sets of different batches are distributed to different GPUs for training at the same time, and the calculations are calculated on different GPUs. Gradient value
Figure PCTCN2020116955-appb-000034
Then calculate the average of the gradients on all GPUs to get
Figure PCTCN2020116955-appb-000035
use
Figure PCTCN2020116955-appb-000036
As the gradient update amount of this training.
最多使用4块GPU设备进行实验分析使用不同数量的GPU对算法训练过程进行加速,训练过程的加速效果如图14所示,由图14可以清晰地看出,随着GPU数量的增加,训练速度呈近乎线性的稳步提升趋势,但也会增加相应的开销如数据通信等。由于训练过程所需计算量非常大,相比较单个GPU训练速度成倍增加,为了能更好的满足外汇市场的高时效性需求,所以适当增加GPU数量会有效提升预测方法的训练速度和在实际应用场景下的可用性。Up to 4 GPU devices are used for experimental analysis. Different numbers of GPUs are used to accelerate the algorithm training process. The acceleration effect of the training process is shown in Figure 14. It can be clearly seen from Figure 14 that as the number of GPUs increases, the training speed Shows a nearly linear steady upward trend, but it will also increase the corresponding overhead such as data communication. Due to the large amount of calculation required in the training process, the training speed of a single GPU has increased exponentially. In order to better meet the high timeliness requirements of the foreign exchange market, an appropriate increase in the number of GPUs will effectively improve the training speed of the prediction method and the actual Usability in application scenarios.
该预测方法的实验环境如下表7所示。The experimental environment of this prediction method is shown in Table 7 below.
表7Table 7
Figure PCTCN2020116955-appb-000037
Figure PCTCN2020116955-appb-000037
使用Python3作为主要编程语言,深度学习框架选用谷歌的TensorFlow。TensorFlow是目前最流行的深度学习框架,可以快速实现各种深度学习算法,有可移植性强、方便灵活、性能好等优点。使用Tensorboard可视化工具,得到预测方法的数据流图如图15所示。图15中,输入数据首先从输入层流入第一个卷积层layer1-conv1,然后再流入第二个卷积层layer2-conv2,经过两层卷积层的卷积计算后流入LSTM循环层layers-lstm,最后流入全连接层计算得出前向传播的预测值,然后根据反向传播算法,使用RMSProp训练优化算法,训练更新每层的参数,最终将训练好的网络保存到硬盘中,以供新数据的预测分析使用。Use Python3 as the main programming language, and use Google's TensorFlow as the deep learning framework. TensorFlow is currently the most popular deep learning framework, which can quickly implement various deep learning algorithms and has the advantages of strong portability, convenience and flexibility, and good performance. Using the Tensorboard visualization tool, the data flow diagram of the prediction method is shown in Figure 15. In Figure 15, the input data first flows from the input layer to the first convolutional layer layer1-conv1, and then flows into the second convolutional layer layer2-conv2, after the convolution calculation of the two convolutional layers, it flows into the LSTM recurrent layer layers -lstm, finally flows into the fully connected layer to calculate the forward propagation prediction value, and then according to the back propagation algorithm, use RMSProp to train the optimization algorithm, train and update the parameters of each layer, and finally save the trained network to the hard disk for use Predictive analysis of new data is used.
该预测方法选取2008年1月3日-2018年1月3日的EURUSD(欧元兑美元)、AUDUSD(澳元兑美元)、XAUUSD(黄金兑美元)、GBPJPY(英镑兑日元)、EURJPY(欧元兑日元)、GBPUSD(英镑兑美元)、USDCHF(美元兑瑞郎)、USDJPY(美元兑日元)、USDCAD(美元兑加元)等9种交易活跃货币对的15分钟数据,原始交易数据从MT4交易平台上下载,美元指数和美国经济指标从金十数据网站 [62]采集。EURUSD(欧元兑美元)的原始数据示例如表8所示,其他货币对数据格式与此类似,文章篇幅有限,不再一一展示。 The prediction method selects EURUSD (Euro to U.S. Dollar), AUDUSD (Australian Dollar to U.S. Dollar), XAUUSD (Gold to U.S. Dollar), GBPJPY (British Pound to Japanese Yen), EURJPY (Euro to U.S. Dollar) from January 3, 2008 to January 3, 2018. 15-minute data of 9 active currency pairs, including GBPUSD (pound sterling to U.S. dollar), USDCHF (U.S. dollar to Swiss franc), USDJPY (U.S. dollar to Japanese yen), and USDCAD (U.S. dollar to Canadian dollar), raw transaction data Downloaded from the MT4 trading platform, the US dollar index and US economic indicators are collected from the Golden Ten Data website [62] . The original data example of EURUSD (Euro to U.S. Dollar) is shown in Table 8. The data format of other currency pairs is similar to this. The article is limited in length and will not be shown one by one.
表8Table 8
datedate timetime openopen highhigh lowlow closeclose usdx_ooenusdx_ooen usdx_highusdx_high usdx_lowusdx_low usdx_closeusdx_close raterate gdpgdp
2008.01.032008.01.03 0:000:00 1.47231.4723 1.47241.4724 1.4721.472 1.47211.4721 76.0576.05 76.0676.06 76.0376.03 76.0676.06 1.921.92 14.7214.72
2008.01.032008.01.03 0:150:15 1.47221.4722 1.47251.4725 1.4721.472 1.47241.4724 76.0676.06 76.0876.08 76.0376.03 76.0476.04 1.921.92 14.7214.72
2008.01.032008.01.03 0:300:30 1.47231.4723 1.47251.4725 1.47121.4712 1.47121.4712 76.0476.04 76.0476.04 76.0276.02 76.0276.02 1.921.92 14.7214.72
2008.01.032008.01.03 0:450:45 1.47131.4713 1.47221.4722 1.47111.4711 1.47151.4715 76.0276.02 76.0576.05 75.9675.96 75.9975.99 1.921.92 14.7214.72
由于原始数据只有基本交易数据和经济指标数据,技术指标数据需要根据基本交易数据 计算得出。通过对原始数据进行统计分析发现,原始数据存在缺失问题,而且还存在较强的噪音,特征维度直接单位不一致。针对上述问题,对缺失数据进行了弥补,以前一时刻的数据弥补缺失的数据,以此类推。弥补缺失数据后,对特征做零均值归一化,将原始数据映射到均值为0,标准差为1的分布上,归一化的计算公式为:Since the original data only has basic transaction data and economic index data, technical index data needs to be calculated based on basic transaction data. Through statistical analysis of the original data, it is found that the original data has the problem of missing, and there is also strong noise, and the direct unit of the feature dimension is inconsistent. In response to the above problems, the missing data was compensated, the data at the previous moment compensated for the missing data, and so on. After making up for the missing data, normalize the feature with zero mean, and map the original data to a distribution with a mean of 0 and a standard deviation of 1. The normalized calculation formula is:
Figure PCTCN2020116955-appb-000038
Figure PCTCN2020116955-appb-000038
式(16)中,μ为原始特征的均值,σ为标准差。通过对原始数据弥补和归一化,保证了原始数据的完整性和规范性。选择前80%数据作为训练集,剩余20%数据作为测试集。构建对比方法,首先初始化必要的超参数值:滞后期数设定为30,隐藏层数设置为三层,隐藏层节点数设置为128,损失函数选用均方误差,优化方法选用RMSProp,batch_size设置为300,训练迭代次数设置为1000。In formula (16), μ is the mean value of the original features, and σ is the standard deviation. By making up and normalizing the original data, the integrity and standardization of the original data are guaranteed. Select the first 80% of the data as the training set, and the remaining 20% as the test set. To construct the comparison method, first initialize the necessary hyperparameter values: the number of lag periods is set to 30, the number of hidden layers is set to three, the number of hidden layer nodes is set to 128, the loss function is selected as the mean square error, and the optimization method is selected as RMSProp and batch_size. Is 300, and the number of training iterations is set to 1000.
由于该算法为回归算法,因此预测效果评价标准选用RMSE(Root Mean Square Error,均方根误差)。RMSE对序列的预测误差非常敏感,能够很好的反应出算法的预测精度,RMSE值越小,算法的预测精度越高,RMSE的计算公式如下:Since this algorithm is a regression algorithm, RMSE (Root Mean Square Error) is selected as the evaluation standard of prediction effect. RMSE is very sensitive to the prediction error of the sequence, and can well reflect the prediction accuracy of the algorithm. The smaller the RMSE value, the higher the prediction accuracy of the algorithm. The calculation formula of RMSE is as follows:
Figure PCTCN2020116955-appb-000039
Figure PCTCN2020116955-appb-000039
式(17)中,y i为第i个真实值,
Figure PCTCN2020116955-appb-000040
为第i个预测值,n为预测序列及真实序列的长度。在设定好超参数值的基础上,分别基于BP、CNN、RNN、LSTM神经网络构建对比预测方法,与构建的C-LSTM预测方法进行实验对比分析,根据不同预测方法的均方根误差来评判各种预测方法的预测精度,如果构建的预测方法其均方根误差最小,其预测精度优于其对比预测方法,则可证明基于两种深度学习算法所构建的预测方法在外汇时间序列分析中的有效性和适用性。
In formula (17), y i is the i-th true value,
Figure PCTCN2020116955-appb-000040
Is the i-th predicted value, and n is the length of the predicted sequence and the true sequence. On the basis of setting the hyperparameter values, construct a comparative prediction method based on BP, CNN, RNN, and LSTM neural network, and conduct an experimental comparative analysis with the constructed C-LSTM prediction method. According to the root mean square error of different prediction methods Judge the forecast accuracy of various forecasting methods. If the constructed forecasting method has the smallest root mean square error and its forecasting accuracy is better than its comparative forecasting method, it can be proved that the forecasting method constructed based on two deep learning algorithms can be used in foreign exchange time series analysis. Validity and applicability in the
基于CNN和LSTM两种深度学习算法构建了C-LSTM外汇时间序列短期预测方法,并选择出了相对最优的输入特征组合、最佳滞后期数、最优的隐藏层大小和算法结合方式以及效果最好的训练方法,进一步提高了C-LSTM预测方法的预测精度。Based on two deep learning algorithms of CNN and LSTM, the C-LSTM foreign exchange time series short-term prediction method was constructed, and the relatively optimal combination of input features, the optimal number of lag periods, the optimal hidden layer size and algorithm combination method were selected, and The training method with the best effect further improves the prediction accuracy of the C-LSTM prediction method.
为了验证构建的C-LSTM外汇时间序列短期预测方法在外汇市场分析预测中的有效性和适用性,分别使用BP、CNN、RNN|和LSTM等不同的神经网络算法构建了多个对比预测方法,对比分析多个预测方法的预测效果,预测方法在测试集数据中得出的RMSE值越低,其预测效果越好。具体实验结果如下表9所示,将表9可视化得到图16所示。In order to verify the effectiveness and applicability of the constructed C-LSTM foreign exchange time series short-term forecasting method in foreign exchange market analysis and forecasting, different neural network algorithms such as BP, CNN, RNN| and LSTM were used to construct multiple comparative forecasting methods. To compare and analyze the forecasting effects of multiple forecasting methods, the lower the RMSE value obtained by the forecasting method in the test set data, the better the forecasting effect. The specific experimental results are shown in Table 9 below, and Table 9 is visualized as shown in Figure 16.
表9Table 9
Figure PCTCN2020116955-appb-000041
Figure PCTCN2020116955-appb-000041
EURUSD(欧元兑美元)货币对部分测试数据预测效果拟合图如下所示,限于文章篇幅,所有货币对的测试数据预测效果拟合图不在此全部展示,根据其他货币对的测试数据预测效果拟合图可得出一致的结论。The fitting diagram of the prediction effect of some test data on the EURUSD (Euro to U.S. dollar) currency pair is shown below. Due to the limitation of the length of the article, the fitting diagram of the prediction effect of the test data of all currency pairs is not shown here. The prediction effect is based on the test data of other currency pairs. Combine the pictures to draw a consistent conclusion.
由图16-21可以直观看出,所构建的C-LSTM预测方法在9种不同货币上的RMSE值均最低,预测效果拟合图的拟合效果最好,因此,根据实验数据可知,构建的预测方法的预测效果优于全部对比预测方法,充分证明了构建的C-LSTM外汇时间序列短期预测方法在外汇时间序列分析中的有效性和适用性。From Figure 16-21, it can be seen intuitively that the constructed C-LSTM prediction method has the lowest RMSE value on 9 different currencies, and the prediction effect fitting graph has the best fitting effect. Therefore, according to the experimental data, the construction The forecasting effect of the forecasting method is better than that of all comparative forecasting methods, which fully proves the effectiveness and applicability of the constructed C-LSTM foreign exchange time series short-term forecasting method in foreign exchange time series analysis.
进一步分析,RNN预测方法的预测效果最差,随着迭代次数的增加,RNN预测效果没有改善,出现了梯度消失问题,对应的LSTM预测方法的预测效果有较大提升,证明了LSTM网络结构可以有效解决梯度消失问题。其中BP神经网络算法也取得了相对不错的预测效果,但是对于较为复杂的问题来说,BP神经网络的预测效果低于CNN、LSTM等深度神经网络的预测效果。CNN神经网络的预测效果虽然优于BP和、RNN神经网络,但是由于其对于难以有效挖掘数据中的时间先后特征,因此其预测效果低于LSTM的预测效果。构建的C-LSTM预测方法,将LSTM和CNN的优势特性进行有效结合,充分挖掘了外汇时间序列数据的时空特征,提高了预测方法的预测精度。Further analysis, the prediction effect of the RNN prediction method is the worst. As the number of iterations increases, the RNN prediction effect does not improve, and the problem of gradient disappearance occurs. The prediction effect of the corresponding LSTM prediction method has been greatly improved, which proves that the LSTM network structure can Effectively solve the problem of gradient disappearance. Among them, the BP neural network algorithm has also achieved relatively good prediction results, but for more complex problems, the prediction effect of the BP neural network is lower than that of deep neural networks such as CNN and LSTM. Although the prediction effect of CNN neural network is better than that of BP and RNN neural networks, its prediction effect is lower than that of LSTM because it is difficult to effectively mine the temporal characteristics of data. The constructed C-LSTM prediction method effectively combines the advantages of LSTM and CNN, fully excavates the temporal and spatial characteristics of foreign exchange time series data, and improves the prediction accuracy of the prediction method.
综上所述,结合CNN和LSTM两种深度学习算法构建了C-LSTM外汇时间序列短期预测方法,其预测效果均优于两种算法单独使用的效果和BP、RNN神经网络的预测效果,充分证明了对两种深度学习算法结合的有效性以及该预测方法在外汇时间序列分析中的适用性。可以为提高深度学习算法的预测精度提供一定的参考,同时对深度学习技术在外汇时间序列分析中的应用提供一定的理论和实践价值。In summary, the C-LSTM foreign exchange time series short-term prediction method is constructed by combining the two deep learning algorithms of CNN and LSTM. Its prediction effect is better than that of the two algorithms alone and the prediction effect of BP and RNN neural networks. It proves the effectiveness of the combination of the two deep learning algorithms and the applicability of the forecasting method in the analysis of foreign exchange time series. It can provide a certain reference for improving the prediction accuracy of deep learning algorithms, and at the same time provide certain theoretical and practical value for the application of deep learning technology in foreign exchange time series analysis.
当然,上述说明并非是对本发明的限制,本发明也并不仅限于上述举例,本技术领域的技术人员在本发明的实质范围内所做出的变化、改型、添加或替换,也应属于本发明的保护范围。Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by those skilled in the art within the essential scope of the present invention shall also belong to the present invention. The scope of protection of the invention.

Claims (10)

  1. 一种外汇时间序列预测方法,其特征在于,包括以下步骤:A foreign exchange time series forecasting method is characterized in that it comprises the following steps:
    步骤1,构建基于卷积神经网络和长短期记忆网络相结合的C-LSTM的预测方法,具体包括:Step 1. Construct a C-LSTM prediction method based on the combination of convolutional neural network and long short-term memory network, which specifically includes:
    1-1,构建基于卷积神经网络和长短期记忆网络相结合的C-LSTM的网络模型,具体包括:1-1. Construct a C-LSTM network model based on the combination of convolutional neural network and long short-term memory network, including:
    1-1-1,构建包括输入层、隐藏层、输出层、网络训练和网络预测的五个功能模块;1-1-1, build five functional modules including input layer, hidden layer, output layer, network training and network prediction;
    1-1-2,构建基于卷积神经网络和长短期记忆网络相结合的C-LSTM的外汇时间序列短期预测方法的训练和预测算法;1-1-2, construct training and prediction algorithms for the C-LSTM short-term prediction method of foreign exchange time series based on the combination of convolutional neural network and long short-term memory network;
    1-2,选择卷积神经网络和长短期记忆网络相结合的C-LSTM的激活函数;1-2. Choose the activation function of C-LSTM that combines convolutional neural network and long-term short-term memory network;
    1-3,定义卷积神经网络和长短期记忆网络相结合的C-LSTM的损失函数;1-3, define the loss function of C-LSTM combining convolutional neural network and long short-term memory network;
    1-4,选择交易类指标和基本面数据作为卷积神经网络和长短期记忆网络相结合的C-LSTM的输入特征;1-4. Select transaction indicators and fundamental data as the input features of C-LSTM combined with convolutional neural network and long- and short-term memory network;
    步骤2,从输入特征、网络结构和训练方法三个方面对步骤1构建的方法进行训练优化,训练优化项目包括主成分分析的特征优化、卷积神经网络和长短期记忆网络相结合的C-LSTM滞后期数优化、卷积神经网络和长短期记忆网络网络相结合的C-LSTM结构优化、卷积神经网络和长短期记忆网络相结合的C-LSTM训练方法优化、基于GPU的并行优化;Step 2. Train and optimize the method constructed in Step 1 from the three aspects of input features, network structure and training methods. The training optimization items include feature optimization of principal component analysis, convolutional neural network and long- and short-term memory network combined C- LSTM lag period optimization, C-LSTM structure optimization combining convolutional neural network and long short-term memory network, C-LSTM training method optimization combining convolutional neural network and long short-term memory network, GPU-based parallel optimization;
    输入特征方面,选取18个指标数据作为输入特征,18个指标数据分为四大类:基本交易数据、技术指标数据、美元指数和国家经济指标,将这四类指标进行组合,并基于主成分分析法进行输入特征的优化,研究不同指标对预测精度的影响并选取最佳的输入特征,然后实验研究滞后期数对预测精度的影响,从而选择最佳的滞后期数;In terms of input features, 18 indicator data are selected as input features. The 18 indicator data are divided into four categories: basic transaction data, technical indicator data, dollar index and national economic indicators. These four types of indicators are combined and based on principal components. The analysis method optimizes the input features, studies the impact of different indicators on the prediction accuracy and selects the best input features, and then experimentally studies the impact of the number of lag periods on the prediction accuracy, so as to select the best number of lag periods;
    网络结构方面,根据网格搜索算法研究最佳的隐藏层结构大小,通过改变不同的卷积神经网络和长短期记忆网络的结合方式,研究不同的算法结合方式对预测精度的影响,选择最佳的隐藏层大小和算法结合方式;In terms of network structure, according to the grid search algorithm to study the best hidden layer structure size, by changing the combination of different convolutional neural networks and long and short-term memory networks, to study the impact of different algorithm combinations on the prediction accuracy, and choose the best The hidden layer size and algorithm combination method;
    训练方法方面,采用Adam、SGD以及RMSProp方法进行网络的训练,通过对比训练后的算法预测精度以及在训练过程中,损失函数随迭代次数的变化情况和收敛速度,研究不同的训练方法对训练效果和预测精度的影响,最终选择合适的训练方法。In terms of training methods, the Adam, SGD, and RMSProp methods are used to train the network. By comparing the prediction accuracy of the training algorithm and the change of the loss function with the number of iterations and the convergence speed during the training process, the effect of different training methods on the training is studied. And the impact of prediction accuracy, and finally choose the appropriate training method.
  2. 如权利要求1所述的一种外汇时间序列预测方法,其特征在于,所述步骤1中选择relu函数作为卷积神经网络和长短期记忆网络相结合的C-LSTM的激活函数,网络结构中加入激活函数后,神经网络具有非线性系统的拟合能力。A foreign exchange time series prediction method according to claim 1, wherein in said step 1, the relu function is selected as the activation function of the C-LSTM that combines the convolutional neural network and the long- and short-term memory network, and in the network structure After adding the activation function, the neural network has the ability to fit nonlinear systems.
  3. 如权利要求1所述的一种外汇时间序列预测方法,其特征在于,所述步骤1中,选用均方误差作为损失函数,损失函数为式(1)所示,A foreign exchange time series prediction method according to claim 1, wherein in said step 1, the mean square error is selected as the loss function, and the loss function is shown in formula (1),
    Figure PCTCN2020116955-appb-100001
    Figure PCTCN2020116955-appb-100001
    其中,y i为数据序列batch中第i个数据所对应的正确答案,
    Figure PCTCN2020116955-appb-100002
    为第i个数据所对应的神经网络预测值。
    Among them, y i is the correct answer corresponding to the i-th data in the data sequence batch,
    Figure PCTCN2020116955-appb-100002
    Is the predicted value of the neural network corresponding to the i-th data.
  4. 如权利要求1所述的一种外汇时间序列预测方法,其特征在于,所述步骤1中,通过交易类指标计算得出技术指标,常用的技术指标包括移动平行线和平滑异同移动平行线,移动平行线和平滑异同移动平行线用于反映当前汇价变动的趋势,通过反趋势指标判断趋势转折点,反趋势指标包括随机指标、乖离率、相对强弱指标和价格变动率。A foreign exchange time series forecasting method according to claim 1, characterized in that, in said step 1, technical indicators are calculated by trading indicators, and commonly used technical indicators include moving parallel lines and smooth moving parallel lines. Moving parallel lines and smoothing similarities and differences moving parallel lines are used to reflect the current trend of exchange rate changes. Anti-trend indicators are used to determine trend turning points. Anti-trend indicators include stochastic indicators, deviation rates, relative strength indicators, and price changes.
  5. 如权利要求4所述的一种外汇时间序列预测方法,其特征在于,所述移动平行线指标是计算某段时期内汇率收盘价的平均值,以该平均值作为判断趋势变化的依据,具体计算公式如式(2)所示,A foreign exchange time series forecasting method according to claim 4, wherein the moving parallel line indicator is to calculate the average value of the closing price of the exchange rate in a certain period of time, and the average value is used as the basis for judging the trend change. The calculation formula is shown in formula (2),
    Figure PCTCN2020116955-appb-100003
    Figure PCTCN2020116955-appb-100003
    其中,N代表时间周期,close i代表第i天的收盘价; Among them, N represents the time period, close i represents the closing price of the i-th day;
    选取快速移动平均线和慢速移动平均线,再求出DIF的平滑移动平均线DEA,最后得出平滑异同移动平均线,具体计算如式(3)-(7)所示,Select the fast moving average and the slow moving average, and then calculate the DIF smooth moving average DEA, and finally get the smooth similarity and difference moving average. The specific calculation is shown in formulas (3)-(7).
    Figure PCTCN2020116955-appb-100004
    Figure PCTCN2020116955-appb-100004
    Figure PCTCN2020116955-appb-100005
    Figure PCTCN2020116955-appb-100005
    Figure PCTCN2020116955-appb-100006
    Figure PCTCN2020116955-appb-100006
    Figure PCTCN2020116955-appb-100007
    Figure PCTCN2020116955-appb-100007
    BAR=2×(DIF-DEA)    (7)BAR=2×(DIF-DEA) (7)
    在式(3)-(7)中,EMA -1为前一日的指数移动平均值,Close为今日收盘价,BAR即为MACD柱状图的高度值。 In formulas (3)-(7), EMA -1 is the exponential moving average of the previous day, Close is today's closing price, and BAR is the height of the MACD histogram.
  6. 如权利要求4所述的一种外汇时间序列预测方法,其特征在于,随机指标的具体计算式如式(8)-(11)所示,A foreign exchange time series forecasting method according to claim 4, characterized in that the specific calculation formula of the stochastic index is as shown in formulas (8)-(11),
    RSV N=(Close (N)-Low (N))÷(High (N)-Low (N))×100%    (8) RSV N = (Close (N) -Low (N) )÷(High (N) -Low (N) )×100% (8)
    Figure PCTCN2020116955-appb-100008
    Figure PCTCN2020116955-appb-100008
    Figure PCTCN2020116955-appb-100009
    Figure PCTCN2020116955-appb-100009
    J=3×K-2×D    (11)J=3×K-2×D (11)
    其中,Close (N)为N日内收盘价平均值,Low (N)为N日内的最低价,High (N)为N日内的最高价,K -1为前一日K值,D -1为前一日D值; Among them, Close (N) is the average closing price in N days, Low (N) is the lowest price in N days, High (N) is the highest price in N days, K -1 is the K value of the previous day, and D -1 is D value of the previous day;
    乖离率的具体计算式如式(12),The specific calculation formula of the deviation rate is as formula (12),
    Figure PCTCN2020116955-appb-100010
    Figure PCTCN2020116955-appb-100010
    其中,Close为当日收盘价,N为时间周期,取值为12;Among them, Close is the closing price of the day, N is the time period, and the value is 12;
    相对强弱指标的计算式如式(13),The calculation formula of the relative strength index is as formula (13),
    Figure PCTCN2020116955-appb-100011
    Figure PCTCN2020116955-appb-100011
    其中,Rise i是第i日收盘价涨幅,Fall i是第i日收盘价跌幅; Among them, Rise i is the increase in the closing price on the i day, and Fall i is the decrease in the closing price on the i day;
    价格变动率的计算公式为式(14),The formula for calculating the rate of price change is equation (14),
    ROC=Close÷Close -N    (14) ROC=Close÷Close -N (14)
    其中,Close是当日收盘价,Close -N前N日的收盘价。 Among them, Close is the closing price of the day, and Close -N is the closing price of the previous N days.
  7. 如权利要求1述的一种外汇时间序列预测方法,其特征在于,步骤2中,基于PCA构建特征优化算法,对输入特征进行降维除燥。A foreign exchange time series prediction method according to claim 1, characterized in that, in step 2, a feature optimization algorithm is constructed based on PCA, and the input features are reduced in dimensionality.
  8. 如权利要求1述的一种外汇时间序列预测方法,其特征在于,基于PCA构建特征优化算法步骤具体为:A foreign exchange time series forecasting method according to claim 1, wherein the step of constructing a feature optimization algorithm based on PCA is specifically:
    对输入的n维特征矩阵D进行中心化处理,即每列数据均减去该列均值μ;Perform centralization processing on the input n-dimensional feature matrix D, that is, each column of data is subtracted from the column mean μ;
    计算中心化后的输入特征矩阵的协方差矩阵S;Calculate the covariance matrix S of the input feature matrix after centering;
    对计算出的协方差矩阵的特征值λ及其对应的特征向量ω,并将特征值从大到小排序λ 12,…,λ nFor the calculated eigenvalue λ of the covariance matrix and its corresponding eigenvector ω, and sort the eigenvalues from large to small λ 1 , λ 2 ,..., λ n ;
    取前k大特征值λ 12,…,λ k对应的特征向量ω 12,…,ω k,通过式(15)将n维特征映射到k维, Take the eigenvectors ω 1 , ω 2 ,..., ω k corresponding to the first k large eigenvalues λ 1 , λ 2 ,..., λ k , and map the n-dimensional features to k-dimensional through equation (15),
    Figure PCTCN2020116955-appb-100012
    Figure PCTCN2020116955-appb-100012
    新的x′ i的第k维就是x i在第k个主成分ω k方向上的投影,通过选取最大的k个特征值对应的特征向量,将方差较小的特征丢弃,使得每个n维列向量被映射为k维列向量x′ i,得到k维的特征矩阵D′。 The k- th dimension of the new x′ i is the projection of x i in the direction of the k-th principal component ω k . By selecting the eigenvectors corresponding to the largest k eigenvalues, the features with the smaller variance are discarded, so that each n The dimensional column vector is mapped to a k-dimensional column vector x′ i , and a k-dimensional feature matrix D′ is obtained.
  9. 如权利要求1述的一种外汇时间序列预测方法,其特征在于,步骤2中卷积神经网络和长短期记忆网络相结合的C-LSTM网络结构优化包括以下部分:A foreign exchange time series prediction method according to claim 1, wherein the optimization of the C-LSTM network structure combining the convolutional neural network and the long- and short-term memory network in step 2 includes the following parts:
    长短期记忆网络循环层超参数优化;Hyperparameter optimization of cyclic layer of long-short-term memory network;
    卷积层超参数优化;Convolutional layer hyperparameter optimization;
    算法结合方式优化,卷积神经网络和长短期记忆网络的结合方式包括:The algorithm combination method is optimized. The combination method of convolutional neural network and long short-term memory network includes:
    先卷积神经网络后长短期记忆网络,卷积神经网络层的输出作为长短期记忆网络层的输入;The convolutional neural network is first followed by the long and short-term memory network, and the output of the convolutional neural network layer is used as the input of the long and short-term memory network layer;
    先长短期记忆网络后卷积神经网络,长短期记忆网络层的输出作为卷积神经网络层的输入;The long-short-term memory network is first followed by the convolutional neural network, and the output of the long-short-term memory network layer is used as the input of the convolutional neural network layer;
    卷积神经网络后长短期记忆网络分别进行,结合两种算法的输出做最终的预测。After the convolutional neural network, the long and short-term memory network is performed separately, and the output of the two algorithms is combined to make the final prediction.
  10. 如权利要求1述的一种外汇时间序列预测方法,其特征在于,所述步骤2中,采用Adam、SGD以及RMSProp方法进行网络的训练,选择使用RMSProp训练优化方法,RMSProp训练优化方法收敛速度快,训练过程最稳定,训练优化效果最好。A foreign exchange time series prediction method according to claim 1, characterized in that, in said step 2, Adam, SGD and RMSProp methods are used for network training, and RMSProp training optimization method is selected, and the RMSProp training optimization method has a fast convergence speed , The training process is the most stable, and the training optimization effect is the best.
PCT/CN2020/116955 2019-10-29 2020-09-23 Foreign exchange time series prediction method WO2021082811A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911035230.0 2019-10-29
CN201911035230.0A CN110782096A (en) 2019-10-29 2019-10-29 Forex time series prediction method

Publications (1)

Publication Number Publication Date
WO2021082811A1 true WO2021082811A1 (en) 2021-05-06

Family

ID=69387210

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116955 WO2021082811A1 (en) 2019-10-29 2020-09-23 Foreign exchange time series prediction method

Country Status (2)

Country Link
CN (1) CN110782096A (en)
WO (1) WO2021082811A1 (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113554873A (en) * 2021-07-20 2021-10-26 重庆大学 Travel time volatility prediction method and device based on high-order moment
CN113569473A (en) * 2021-07-19 2021-10-29 浙江大学 Air separation pipe network oxygen long-term prediction method based on polynomial characteristic LSTM granularity calculation
CN113642225A (en) * 2021-05-24 2021-11-12 国网新疆电力有限公司经济技术研究院 CNN-LSTM short-term wind power prediction method based on attention mechanism
CN113724780A (en) * 2021-09-16 2021-11-30 上海交通大学 Method for realizing prediction of protein coiled-coil structure characteristics based on deep learning
CN113920408A (en) * 2021-09-10 2022-01-11 天津理工大学 Photonic crystal transmission spectrum sequence feature extraction method based on CNN-RNN parallel fusion
CN114205138A (en) * 2021-12-09 2022-03-18 麒麟软件有限公司 Network intrusion detection method for container cloud platform
CN114387030A (en) * 2022-01-13 2022-04-22 瑞祥全球购超市有限公司 Online user quantity intelligent analysis method oriented to online shopping platform
CN114913296A (en) * 2022-05-07 2022-08-16 中国石油大学(华东) MODIS surface temperature data product reconstruction method
CN115018553A (en) * 2022-06-30 2022-09-06 东南大学 Regional logistics single quantity prediction system and method based on deep learning
CN115456073A (en) * 2022-09-14 2022-12-09 杭州电子科技大学 Generation type confrontation network model modeling analysis method based on long-term and short-term memory
WO2023169589A1 (en) * 2022-03-07 2023-09-14 东南大学 Predictive channel modeling method based on adversarial network and long short-term memory network
CN116805514A (en) * 2023-08-25 2023-09-26 鲁东大学 DNA sequence function prediction method based on deep learning
CN117349774A (en) * 2023-10-24 2024-01-05 重庆邮电大学 Block chain abnormal transaction detection method based on big data

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110796306A (en) * 2019-10-29 2020-02-14 山东科技大学 Construction method for forex time series prediction
CN110751562A (en) * 2019-10-29 2020-02-04 山东科技大学 Training optimization method for foreigner time sequence prediction
CN110782096A (en) * 2019-10-29 2020-02-11 山东科技大学 Forex time series prediction method
CN111415050B (en) * 2020-04-27 2023-12-05 新奥新智科技有限公司 Short-term load prediction method, short-term load prediction model training method and device
CN111639823B (en) * 2020-06-10 2022-09-23 天津大学 Building cold and heat load prediction method constructed based on feature set
CN112116381B (en) * 2020-08-31 2021-05-07 北京基调网络股份有限公司 Moon life prediction method based on LSTM neural network, storage medium and computer equipment
CN112598526A (en) * 2021-03-04 2021-04-02 蚂蚁智信(杭州)信息技术有限公司 Asset data processing method and device
CN116777506A (en) * 2023-05-16 2023-09-19 济南明泉数字商务有限公司 Bulk product transaction decision-making method and system based on generation type AI service

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886846A (en) * 2017-04-26 2017-06-23 中南大学 A kind of bank outlets' excess reserve Forecasting Methodology that Recognition with Recurrent Neural Network is remembered based on shot and long term
CN108305167A (en) * 2018-01-12 2018-07-20 华南理工大学 A kind of foreign currency trade method and system enhancing learning algorithm based on depth
CN108694480A (en) * 2018-07-13 2018-10-23 西南石油大学 Finance data prediction technique based on improved length memory network in short-term
AU2018101512A4 (en) * 2018-10-11 2018-11-15 Dong, Xun Miss A comprehensive stock trend predicting method based on neural networks
CN109360097A (en) * 2018-09-28 2019-02-19 中山大学 Prediction of Stock Index method, apparatus, equipment and storage medium based on deep learning
CN109711461A (en) * 2018-12-25 2019-05-03 中国人民解放军战略支援部队航天工程大学 Transfer learning picture classification method and its device based on principal component analysis
CN110782096A (en) * 2019-10-29 2020-02-11 山东科技大学 Forex time series prediction method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10783900B2 (en) * 2014-10-03 2020-09-22 Google Llc Convolutional, long short-term memory, fully connected deep neural networks
CN105787582A (en) * 2015-12-24 2016-07-20 清华大学 Stock risk prediction method and apparatus
CN107832897A (en) * 2017-11-30 2018-03-23 浙江工业大学 A kind of Stock Price Forecasting method based on deep learning
KR102008845B1 (en) * 2017-11-30 2019-10-21 굿모니터링 주식회사 Automatic classification method of unstructured data
CN109190834A (en) * 2018-09-12 2019-01-11 百色学院 Stock price trend prediction method and system neural network based
CN109816140A (en) * 2018-12-12 2019-05-28 哈尔滨工业大学(深圳) Forecasting of Stock Prices method, apparatus, equipment and the storage medium influenced based on cross-market

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886846A (en) * 2017-04-26 2017-06-23 中南大学 A kind of bank outlets' excess reserve Forecasting Methodology that Recognition with Recurrent Neural Network is remembered based on shot and long term
CN108305167A (en) * 2018-01-12 2018-07-20 华南理工大学 A kind of foreign currency trade method and system enhancing learning algorithm based on depth
CN108694480A (en) * 2018-07-13 2018-10-23 西南石油大学 Finance data prediction technique based on improved length memory network in short-term
CN109360097A (en) * 2018-09-28 2019-02-19 中山大学 Prediction of Stock Index method, apparatus, equipment and storage medium based on deep learning
AU2018101512A4 (en) * 2018-10-11 2018-11-15 Dong, Xun Miss A comprehensive stock trend predicting method based on neural networks
CN109711461A (en) * 2018-12-25 2019-05-03 中国人民解放军战略支援部队航天工程大学 Transfer learning picture classification method and its device based on principal component analysis
CN110782096A (en) * 2019-10-29 2020-02-11 山东科技大学 Forex time series prediction method

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113642225A (en) * 2021-05-24 2021-11-12 国网新疆电力有限公司经济技术研究院 CNN-LSTM short-term wind power prediction method based on attention mechanism
CN113569473A (en) * 2021-07-19 2021-10-29 浙江大学 Air separation pipe network oxygen long-term prediction method based on polynomial characteristic LSTM granularity calculation
CN113554873A (en) * 2021-07-20 2021-10-26 重庆大学 Travel time volatility prediction method and device based on high-order moment
CN113920408A (en) * 2021-09-10 2022-01-11 天津理工大学 Photonic crystal transmission spectrum sequence feature extraction method based on CNN-RNN parallel fusion
CN113724780A (en) * 2021-09-16 2021-11-30 上海交通大学 Method for realizing prediction of protein coiled-coil structure characteristics based on deep learning
CN113724780B (en) * 2021-09-16 2023-10-13 上海交通大学 Protein coiled-coil structure characteristic prediction implementation method based on deep learning
CN114205138A (en) * 2021-12-09 2022-03-18 麒麟软件有限公司 Network intrusion detection method for container cloud platform
CN114387030A (en) * 2022-01-13 2022-04-22 瑞祥全球购超市有限公司 Online user quantity intelligent analysis method oriented to online shopping platform
CN114387030B (en) * 2022-01-13 2024-03-15 瑞祥全球购超市有限公司 Online shopping platform-oriented intelligent analysis method for online user quantity
WO2023169589A1 (en) * 2022-03-07 2023-09-14 东南大学 Predictive channel modeling method based on adversarial network and long short-term memory network
CN114913296B (en) * 2022-05-07 2023-08-11 中国石油大学(华东) MODIS surface temperature data product reconstruction method
CN114913296A (en) * 2022-05-07 2022-08-16 中国石油大学(华东) MODIS surface temperature data product reconstruction method
CN115018553A (en) * 2022-06-30 2022-09-06 东南大学 Regional logistics single quantity prediction system and method based on deep learning
CN115018553B (en) * 2022-06-30 2024-05-07 东南大学 Regional logistics single quantity prediction system and method based on deep learning
CN115456073B (en) * 2022-09-14 2023-07-07 杭州电子科技大学 Long-short-term memory-based modeling analysis method for generating type countermeasure network model
CN115456073A (en) * 2022-09-14 2022-12-09 杭州电子科技大学 Generation type confrontation network model modeling analysis method based on long-term and short-term memory
CN116805514A (en) * 2023-08-25 2023-09-26 鲁东大学 DNA sequence function prediction method based on deep learning
CN116805514B (en) * 2023-08-25 2023-11-21 鲁东大学 DNA sequence function prediction method based on deep learning
CN117349774A (en) * 2023-10-24 2024-01-05 重庆邮电大学 Block chain abnormal transaction detection method based on big data

Also Published As

Publication number Publication date
CN110782096A (en) 2020-02-11

Similar Documents

Publication Publication Date Title
WO2021082809A1 (en) Training optimization method for foreign exchange time series prediction
WO2021082811A1 (en) Foreign exchange time series prediction method
WO2021082810A1 (en) Construction method for foreign exchange time series prediction
Li et al. Risk prediction in financial management of listed companies based on optimized BP neural network under digital economy
Vochozka et al. Predicting future Brent oil price on global markets.
Wu et al. Portfolio management system in equity market neutral using reinforcement learning
Sermpinis et al. Neural networks in financial trading
Li et al. Heterogeneous ensemble learning with feature engineering for default prediction in peer-to-peer lending in China
CN109191276A (en) A kind of P2P network loan institutional risk appraisal procedure based on intensified learning
Wei et al. Exploring the financial indicators to improve the pattern recognition of economic data based on machine learning
Ruyu et al. A comparison of credit rating classification models based on spark-evidence from lending-club
Syu et al. Portfolio management system with reinforcement learning
Liang et al. The analysis of global RMB exchange rate forecasting and risk early warning using ARIMA and CNN model
Zhang et al. A novel Bitcoin and gold prices prediction method using an LSTM-P neural network model
Kang et al. A CWGAN-GP-based multi-task learning model for consumer credit scoring
Sakhare et al. Prediction of stock market movement via technical analysis of stock data stored on blockchain using novel History Bits based machine learning algorithm
Pandey et al. A review and empirical analysis of neural networks based exchange rate prediction
Behura et al. Stock Price Prediction using Multi-Layered Sequential LSTM
Samarawickrama et al. Multi-step-ahead prediction of exchange rates using artificial neural networks: a study on selected sri lankan foreign exchange rates
Liashenko et al. Neural Networks in Application to Cryptocurrency Exchange Modeling.
Goyal Financial Time Series Stock Price Prediction using Deep Learning
Liu et al. A new LASSO-BiLSTM-based ensemble learning approach for exchange rate forecasting
Sun et al. A Portfolio Trading System of Digital Currencies
Buczynski et al. GARCHNet: Value-at-Risk Forecasting with GARCH Models Based on Neural Networks
Friday et al. IRGM: An Integrated RNN-GRU Model for Stock Market Price Prediction

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20882690

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20882690

Country of ref document: EP

Kind code of ref document: A1