金融时间序列的长短期记忆神经网络外文翻译资料

 2023-04-11 04:04

Long Short-Term Memory Neural Network

for Financial Time Series

Abstract

Performance forecasting is an age-old problem in economics and finance. Recently, developments in machine learning and neural networks have given rise to non-linear time series models that provide modern and promising alternatives to traditional methods of analysis. In this paper, we present an ensemble of independent and parallel long short-term memory (LSTM) neural networks for the prediction of stock price movement. LSTMs have been shown to be especially suited for time series data due to their ability to incorporate past information, while neural network ensembles have been found to reduce variability in results and improve generalization. A binary classification problem based on the median of returns is used, and the ensemblersquo;s forecast depends on a threshold value, which is the minimum number of LSTMs required to agree upon the result. The model is applied to the constituents of the smaller, less efficient Stockholm OMX30 instead of other major market indices such as the DJIA and Samp;P500 commonly found in literature. With a straightforward trading strategy, comparisons with a randomly chosen portfolio and a portfolio containing all the stocks in the index show that the portfolio resulting from the LSTM ensemble provides better average daily returns and higher cumulative returns over time. Moreover, the LSTM portfolio also exhibits less volatility, leading to higher risk-return ratios.

1 Introduction

Prediction of asset prices has long been a central endeavor in mathematical finance and econometrics. Financial time series, however, are notoriously challenging to analyze because of their nonstationarity, nonlinearity, and noise, resulting from the irrational human behavior that drive the data. In the past, methods used are those of traditional nature such as ones based on Autoregressive Integrated Moving Average (ARIMA), Generalized Autoregressive Conditional Heteroskedasticity (GARCH), as well as other stochastic volatility models (see, for example, [5, 6, 28, 34]). The use of these models often entail making assumptions about the data, its underlying distribution, and the different processes affecting it. Because of these assumptions, these methods often generalize poorly for new, out-of-sample data, even though they fifit the current data well and do provide valuable insights into the time series [32]. Recently, developments in machine learning and neural networks have given rise to non-linear time series models that are increasingly being adapted for fifinancial applications. Support vector machines (SVM), restricted Boltzmann machines (RBM), random forests, gradient boosted trees (GBM), and multilayer perceptrons (MLP) are just some examples of the machine learning models that are being used [26, 19, 25, 31, 11]. Amongst these models, one particular type of machine learning architecture, a recurrent neural network (RNN), has been shown, compared to others, to be better suited for sequential data such as time series. The suitability is due to the feedback loops in RNNs that allow them to use information not just from the current input, but also from past inputs. This is unlike other neural networks that, in general, process inputs as separate, independent data points. There is however, one major problem with RNNs - their inability to learn long-term dependencies due to the infamous vanishing gradient problem [2, 4, 20]. To address this, the long short-term memory (LSTM) was introduced.

In this paper, an LSTM model is used. A type of RNN, an LSTM also has feedback loops, but moreover, it can also regulate its memory by using a gating mechanism that learns which information to keep, to pass on, and to forget. It is widely used and has been shown to have excellent predictive capabilities in natural language processing, handwriting recognition, image recognition, and image captioning. See, for example, [7, 14, 16, 30, 35]. In finance, LSTMs have been increasingly used for time series analysis. For example, applications for price predictions on major stock market indices all over the world such as the Samp;P500, Shanghairsquo;s SSE Index, Indiarsquo;s NIFTY 50, and Brazilrsquo;s Ibovespa are studied in [2, 8, 17, 22, 27]. In addition, Tsantekidis et al. [33] used LSTMs on Finnish companies to predict price movements through high frequency trading data on a limit order book. Apart from predicting prices, Yeung et al. [37] employed LSTMs to detect jumps in the values of difffferent stock market indices, and Xiong et al. [36] applied LSTMs on the Samp;P500 and Google domestic trends data to forecast price volatility. These are just some examples of LSTM implementations on fifinancial time series showing the neural network to produce promising results. Comparisons with other methods have also been made. Siami-Namini et al. [29], for example, compared LSTM with ARIMA for time series forecasting. They not only used data from major exchanges such as the Dow Jones Industrial Average (DJIA) and Nasdaq Composite, but also other economic time series such as the M1 money supply, currency exchange indices, and transportation data. Results from their study show that LSTM forecasts have signifificantly less root mean square error (RMSE) than those from ARIMA. Fischer and Krauss [12] applied LSTM to Samp;P500 data for price prediction and compared the results with random forest, a standard deep neural network (DNN), and logistic regression. Their findings indicate that LSTM does indeed have higher accuracy than the other approaches, and that LSTM-based portfolios offer higher returns and lower volatilities. Di Persio and Honchar [11], on the other hand, compared LSTM and MLP with their own method, which is an ensemble of wavelets and a convolutional neural network (CNN). Although they reported that their method appears to be super

剩余内容已隐藏,支付完成后下载完整资料


金融时间序列的长短期记忆神经网络

摘 要

绩效预测是经济学和金融学中的一个古老问题。最近,机器学习和神经网络的发展催生了非线性时间序列模型,这些模型为传统分析方法提供了现代且有前途的替代方案。在本文中,我们提出了一个独立且并行的长短期记忆集合(LSTM)神经网络用于预测股价走势。 LSTM 已被证明特别适合时间序列数据,因为它们能够整合过去的信息,而神经网络集成已被发现可以减少结果的可变性并提高泛化能力。使用基于回报中位数的二元分类问题,并且集成的预测取决于阈值,该阈值是同意结果所需的最小 LSTM 数量。该模型适用于规模较小、效率较低的 Stockholm OMX30 的成分股,而不是文献中常见的其他主要市场指数,例如 DJIA 和 Samp;P500。通过简单的交易策略,与随机选择的投资组合和包含指数中所有股票的投资组合的比较表明,由 LSTM 集成产生的投资组合提供了更好的平均每日回报和更高的累积回报。此外,LSTM 投资组合的波动性也较小,从而导致更高的风险回报率。

1 介绍

长期以来,资产价格预测一直是数学金融和计量经济学的核心工作。然而,众所周知,金融时间序列的分析具有挑战性,因为它们的非平稳性、非线性和噪声是由驱动数据的非理性人类行为造成的。过去,使用的方法是传统性质的方法,例如基于自回归综合移动平均线 (ARIMA)、广义自回归条件异方差 (GARCH) 以及其他随机波动率模型(例如[5, 6, 28, 34])。使用这些模型通常需要对数据、其潜在分布以及影响它的不同过程做出假设。由于这些假设,这些方法通常不适用于新的样本外数据,即使它们很好地拟合当前数据并且确实为时间序列提供了有价值的见解 [32]。最近,机器学习和神经网络的发展催生了非线性时间序列模型,这些模型越来越多地适用于金融应用。支持向量机 (SVM)、受限玻尔兹曼机 (RBM)、随机森林、梯度提升树 (GBM) 和多层感知器 (MLP) 只是正在使用的机器学习模型的一些示例 [26, 19, 25, 31, 11]。在这些模型中,一种特殊类型的机器学习架构,即循环神经网络 (RNN),与其他模型相比,已被证明更适合时序数据,例如时间序列。适用性是由于 RNN 中的反馈循环允许它们不仅使用来自当前输入的信息,而且还来自过去输入的信息。这与其他神经网络不同,通常将输入作为单独的独立数据点进行处理。然而,RNN 存在一个主要问题——由于臭名昭著的梯度消失问题 [2,4,20],它们无法学习长期依赖关系。为了解决这个问题,引入了长短期记忆(LSTM)。

在本文中,使用了 LSTM 模型。一种 RNN,LSTM 也有反馈循环,但此外,它还可以通过使用门控机制来调节其记忆,该机制学习哪些信息要保留、传递和忘记。它被广泛使用,并已被证明在自然语言处理、手写识别、图像识别和图像字幕方面具有出色的预测能力。例如,参见 [7, 14, 16, 30, 35]。在金融领域,LSTM 越来越多地用于时间序列分析。例如,在 [2, 8, 17, 22, 27] 中研究了全球主要股票市场指数的价格预测应用,例如 Samp;P500、上海的 SSE 指数、印度的 NIFTY 50 和巴西的 Ibovespa。此外,还有Tsantekidis 等等。 [33] 在芬兰公司中使用 LSTM,通过限价订单簿上的高频交易数据预测价格走势。除了预测价格,还有Yeung 等等。 [37] 使用 LSTM 来检测不同股票市场指数值的跳跃,以及 Xiong 等等。 [36] 在标准普尔 500 指数和谷歌国内趋势数据上应用 LSTM 来预测价格波动。这些只是金融时间序列上 LSTM 实现的一些例子,展示了神经网络产生有希望的结果。还与其他方法进行了比较。 Siami-Namini 等等。例如,[29] 比较了 LSTM 和 ARIMA 的时间序列预测。他们不仅使用了道琼斯工业平均指数 (DJIA) 和纳斯达克综合指数等主要交易所的数据,还使用了 M1 货币供应量、货币兑换指数和运输数据等其他经济时间序列数据。他们的研究结果表明,LSTM 预测的均方根误差 (RMSE) 明显低于 ARIMA 的预测。Fischer 和 Krauss [12] 将 LSTM 应用于 Samp;P500 数据进行价格预测,并将结果与随机森林、标准深度神经网络 (DNN) 和逻辑回归进行比较。他们的研究结果表明,LSTM 确实比其他方法具有更高的准确性,并且基于 LSTM 的投资组合提供更高的回报和更低的波动性。另一方面,Di Persio 和 Honchar [11] 将 LSTM 和 MLP 与他们自己的方法进行了比较,后者是小波和卷积神经网络 (CNN) 的集合。尽管他们报告说他们的方法似乎更优越,但结果与 LSTM [22] 的结果非常接近。

大多数关于 LSTM 在金融时间序列上的应用的文献都是针对主要市场指数的,例如 DJIA 和 Samp;P500。在本文中,将 LSTM 应用于 Stockholm 的 OMX30,以探索基于 LSTM 的方法可以为更小、更不完美的市场提供哪些优势。使用的方法受到 Fischer 和 Krauss [12] 以及 Barra 等人的启发。 LSTM 应用于每日收益序列;然而,与将网络应用于指数本身相反,该模型应用于个股成分股。与文献中常见的回归问题不同,使用基于不同股票的每日中位数的二元分类问题。因此,目标是股票的第二天回报率是高于还是低于中位数。此外,不仅使用了一个 LSTM,还使用了一组独立且并行的 LSTM,其中集成的预测取决于大多数单独的结果。这与 [3]一致,他们认为这样的集合可以消除模型中的大部分随机性并提高结果的可靠性。本文在效率相对较低的瑞典市场上实施的基于中值的二元分类和 LSTM 集成的组合是一种独特的方法。结果表明,与随机选择的投资组合和包含所有考虑的股票的投资组合相比,基于 LSTM 的方法产生的投资组合产生更高的回报、更低的波动性和更高的风险回报率。

本文的其余部分组织如下:第2节详细介绍了 LSTM 及其机制。第3节描述了该方法,其中介绍了数据并解释了神经网络架构、集成和交易策略。 第4节是结果的介绍和讨论。 最后,第5节提供了总结和结论。

2 长短期记忆

如上所述,RNN 特别适用于序列数据,因为它们的反馈回路使它们能够同时使用当前和过去的输入,从而允许信息持续存在。 RNN 的这一特性意味着它们能够在训练和做出预测时学习并考虑趋势和上下文。 然而,有一个主要限制—— RNN 在长期内会因为梯度消失问题而失去记忆。 为了解决这个问题,Hochreiter 和 Schmidhuber [18] 在 1997 年引入了 LSTM 网络。从那时起,它经过多年的修改和改进,例如 [13,14,15,16]。

图 1 显示了一个 LSTM 网络的示例,该网络具有一个输入特征 x、一个具有多个单元的隐藏层和一个输出 y。 LSTM 单元,也称为记忆单元,被放大以显示其内部组件。 一个记忆单元包含三个门,每个门控制应该在记忆中保存、遗忘和传递多少信息作为单元输出。 所有三个门都使用 sigmoid 激活函数,因为它的值范围从 0(对应于无信息)到 1(对应于所有信息)。

图 1:具有放大的 LSTM 单元(记忆细胞)的 LSTM 网络

图中的符号如下:

  • x = (,, ..., ) 是输入向量,其中 , t = 1, . . . , n 是长度为 n 的序列中时间 t 的数据点
  • 是细胞状态,即细胞在时间 t 的记忆
  • 是候选细胞状态
  • 是单元格的输出,也称为隐藏状态
  • 、 和 分别是遗忘门、输入门和输出门的值
  • 、、和是与输入 x 相关的权重矩阵
  • 、、和 是与输出 相关的权重矩阵
  • 、、和 是偏置向量

创建模型时,将初始化单元状态和输出,分别为和。对于前向传递,将序列形式的输入 x = (,, ..., ) 输入模型,其中存储单元连续获取数据点 以计算新的单元状态和输出 . 图 1 放大的存储单元显示了它在处理一个接一个数据点时随时间的演变:、、.......

根据输入 和先前的输出 计算时间 t 的门值,如下所示:

类似地,仍然基于输入 和先前的输出 计算候选单元状态 ,但使用 tanh 激活函数。这表示存储单元已接收到的新信息。

然后根据 (2.0.5) 中的前一个单元状态 和候选单元状态 计算实际单元状态 ,其中遗忘门和输入门 和它的值决定了应该是多少 从 被遗忘并从保留:

最后,根据上面计算的输出门 的值和当前单元状态 计算输出 :

请注意,输出 不仅循环到同一个记忆单元,而且还传递到网络中的其他记忆单元,如图 2 所示。

图 2:来自 LSTM 单元的隐藏状态 不仅会在单元内循环,还会传递到其他 LSTM 单元

其中 m 是隐藏单元的数量,n 是输入神经元的数量, 神经网络中可训练参数的总数为

其中 4mn 是与输入关联的权重数量,4 是与输出 关联的权重数量,4m是偏差数量。

3 方法

3.1 数据

实证调查的数据取自 Stockhom 的 OMX30的成分股。 表 1 按权重列出了指数中排名前十的证券,而表 2 列出了不同的行业。 两者均来自 2019 年 12 月,因为这是提取数据时的最新可用信息。

表 1:按权重划分的 OMX30 十大证券(截至 2019 年 12 月)

2002 年 5 月至 2020 年 1 月的成分股的每日收盘价被下调。 为了避免跟踪成分股随时间的变化,所使用的股票保持为截至 2020 年 2 月的指数。以收盘价 计算每日收益 如下:

根据[12]和[31],计算了股票收益的每日中位数。 然后,如果每只股票的每日回报低于每日中位数,则将其分类为 0,如果其每日回报高于每日回报,则将其分类为 1。 为了创建 LSTM 的输入,为每只股票创建了回报序列,其中每个序列的目标是提前一天预测回报是高于还是低于中位数。 图 3 说明了这一点。

表 2:OMX30 行业分布(截至 2019 年 12 月)

图 3:输入序列和目标

3.2 网络结构

LSTM 模型由一个输入神经元、一个隐藏层和一个输出神经元组成。 输出使用 sigmoid 激活函数,可以解释为置信度的度量。 更接近 1 意味着模型更有信心回报将高于中位数,而更接近 0 意味着更有信心低于中位数。 Adam 优化器与 0.0075 的学习率一起使用,这是在贝叶斯优化 [23] 的帮助下选择的。 相同的贝叶斯优化算法也用于确定其他超参数的值:

bull; number of neurons in hidden layer = 3

bull; dropout = 0.06

bull; recurrent dropout = 0.14

bull; batch size = 6800

3.2.1 训练与测试

对于训练和测试,每只股票的数据被分成长度为 750 天的训练(大约三年交易)、270 天的估值(超过一年的交易)和 270 天的测试,如图所示 图 4. 为每个数据集创建了长度为 240 的序列2。 使用了 30 天的滚动窗口,这导致每个区块有 30 个不重叠的预测天数。 在实践中,这也意味着模型大约每六周重新训练一次。 30 天滚动窗口是基于反复试验选择的,其中较短的滚动窗口会导致过度拟合,而较长的滚动窗口会导致随着数据离训练日期越来越远,预测的准确性会降低。

图 4:测试、验证和训练集块

3.3 集合和阈值

使用神经网络模型的集合被认为可以减少变异并提高泛化性。 因此,与 [3] 一样,使用了多个 LSTM 网络,而不是仅使用一个 LSTM 网络,它们彼此独立并并行训练。 集成图如图 5 所示,其中每个 LSTM 具有第 3.2 节中描述的相同架构,但具有不同的权重初始化。

图 5:LSTM 集合, LSTM 相互独立,并行训练。

使用的不同初始化在 Keras [10] 中很容易获得,其详细信息在表 3 中提供。总共使用了 11 个 LSTM。

由于 LSTM 是独立的,因此它们的输出也是独立的。 关于第二天收益是否高于或低于中值的最终集成预测是基于具有该结果的 LSTM 的最小数量(称为阈值)来决定的。 换句话说,阈值是必须同意预测的 LSTM 的最小数量。 由于有 11 个 LSTM,任何等于或大于 6 的阈值都被认为是多数。

表 3:为各个 LSTM 选择参数的不同权重初始化

3.4 交易策略

对于交易策略,LSTM 集成预测表现优于中位数的股票被购买并添加到等权重的投资组合中。 持有股票,直到模型不再预测它高于中位数,在这种情况下,头寸被平仓。 由此产生的投资组合相当动态,并且每天根据 LSTM 预测进行调整。 投资组合中没有固定数量的股票; 它包含模型预测表现良好的许多股票。

4 结论

4.1 精确度

下面的图 6 显示了三个 LSTM 的测试准确度,包括 Random Normal、Random Unifo

剩余内容已隐藏,支付完成后下载完整资料


资料编号:[589854],资料为PDF文档或Word文档,PDF文档可免费转换为Word

您需要先支付 30元 才能查看全部内容!立即支付

课题毕业论文、文献综述、任务书、外文翻译、程序设计、图纸设计等资料可联系客服协助查找。