使用r语言做garch模型_使用GARCH估计货币波动率

本文介绍了如何使用R语言构建GARCH模型来估计货币市场的波动性,详细解析了相关步骤,帮助理解金融数据波动性的量化分析。
摘要由CSDN通过智能技术生成

使用r语言做garch模型

Asset prices have a high degree of stochastic trends inherent in the time series. In other words, price fluctuations are subject to a large degree of randomness, and therefore it is very difficult to forecast asset prices using traditional time series models such as ARIMA.

资产价格具有时间序列固有的高度随机趋势。 换句话说,价格波动受到很大程度的随机性影响,因此很难使用诸如ARIMA之类的传统时间序列模型来预测资产价格。

Moreover, with much of the trading done on an algorithmic basis today — prices are constantly adjusting on the basis of such forecasts — making it quite hard to exploit an advantage in the markets.

而且,由于当今许多交易都是基于算法进行的-价格在这种预测的基础上不断调整-因此很难在市场中利用优势。

For instance, suppose I build a time series model to predict rainfall in a city for the next three months. My time series model could have a strong degree of accuracy as the forecasts will not influence rainfall levels in the future. However, if everyone uses an ARIMA model to predict asset price fluctuations for the next three months — then subsequent trading on the basis of those forecasts will directly influence previous forecasts — rendering them invalid in many cases.

例如,假设我建立了一个时间序列模型来预测未来三个月城市的降雨。 我的时间序列模型可能具有很高的准确性,因为预测不会影响将来的降雨量。 但是,如果每个人都使用ARIMA模型来预测未来三个月的资产价格波动-那么根据这些预测进行的后续交易将直接影响先前的预测-在许多情况下使它们无效。

背景 (Background)

As a result, it is common to model projected volatility of an asset price in the financial markets — as opposed to forecasting projected price outright.

因此,通常在金融市场中对资产价格的预计波动率建模,而不是直接预测预测价格。

Let’s see how this can be accomplished using Python. A GARCH model is used to forecast volatility for the EUR/USD and GBP/USD currency pairs, using data from January 2017 — January 2018.

让我们看看如何使用Python来实现。 GARCH模型用于使用2017年1月至2018年1月的数据预测EUR / USD和GBP / USD货币对的波动。

The data is sourced from FRED using the Quandl library:

数据使用Quandl库来自FRED:

eurusd = quandl.get("FRED/DEXUSEU", start_date='2017-01-01', end_date='2018-01-01', api_key='enter_api_key')gbpusd = quandl.get("FRED/DEXUSUK", start_date='2017-01-01', end_date='2018-01-01', api_key
  • 2
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值