R中的多元时间序列建模 [英] Multivariate time series modelling in R
问题描述
我想用 R 拟合某种多变量时间序列模型.
I want do fit some sort of multi-variate time series model using R.
这是我的数据示例:
u cci bci cpi gdp dum1 dum2 dum3 dx
16.50 14.00 53.00 45.70 80.63 0 0 1 6.39
17.45 16.00 64.00 46.30 80.90 0 0 0 6.00
18.40 12.00 51.00 47.30 82.40 1 0 0 6.57
19.35 7.00 42.00 48.40 83.38 0 1 0 5.84
20.30 9.00 34.00 49.50 84.38 0 0 1 6.36
20.72 10.00 42.00 50.60 85.17 0 0 0 5.78
21.14 6.00 45.00 51.90 85.60 1 0 0 5.16
21.56 9.00 38.00 52.60 86.14 0 1 0 5.62
21.98 2.00 32.00 53.50 86.23 0 0 1 4.94
22.78 8.00 29.00 53.80 86.24 0 0 0 6.25
数据是季度数据,虚拟变量是季节性的.
The data is quarterly, the dummy variables are for seasonality.
我想做的是参考其他一些预测 dx,同时(可能)考虑季节性.为了论证起见,假设我想使用u"、cci"和gdp".
What I would like to do is to predict dx with reference to some of the others, while (possibly) allowing for seasonality. For argument's sake, lets say I want to use "u", "cci" and "gdp".
我该怎么做?
推荐答案
如果您还没有这样做,请查看 CRAN 上的时间序列视图,尤其是关于多元时间序列的部分.
If you haven't done so already, have a look at the time series view on CRAN, especially the section on multivariate time series.
在金融领域,一种传统的方法是使用因子模型,通常使用 BARRA 或 Fama-French 类型模型.Eric Zivot 的 使用 S-PLUS 建模金融时间序列" 很好地概述了这些主题,但它不能立即转移到 R. Ruey Tsay 的分析of Financial Time Series"(可在 CRAN 上的 TSA 包中找到)在第 9 章中也对因子模型和主成分分析进行了很好的讨论.
In finance, one traditional way of doing this is with a factor model, frequently with either a BARRA or Fama-French type model. Eric Zivot's "Modeling financial time series with S-PLUS" gives a good overview of these topics, but it isn't immediately transferable into R. Ruey Tsay's "Analysis of Financial Time Series" (available in the TSA package on CRAN) also has a nice discussion of factor models and principal component analysis in chapter 9.
R 还提供了许多涵盖 矢量自回归 (VAR) 模型的软件包.特别是,我建议查看 Bernhard Pfaff 的 VAR Modeling (vars) 包和相关小插图.
R also has a number of packages that cover vector autoregression (VAR) models. In particular, I would recommend looking at Bernhard Pfaff's VAR Modelling (vars) package and the related vignette.
我强烈建议您查看 Ruey Tsay 的主页因为它涵盖了所有这些主题,并提供了必要的 R 代码.特别是,请查看应用多元分析","金融时间序列分析"和多元时间序列分析" 课程.
I strongly recommend looking at Ruey Tsay's homepage because it covers all these topics, and provides the necessary R code. In particular, look at the "Applied Multivariate Analysis", "Analysis of Financial Time Series", and "Multivariate Time Series Analysis" courses.
这是一个非常大的主题,有很多好书涵盖了它,包括多元时间序列预测和季节性.还有一些:
This is a very large subject and there are many good books that cover it, including both multivariate time series forcasting and seasonality. Here are a few more:
- Kleiber 和 Zeileis."应用计量经济学与 R" 没有解决这个问题具体来说,但它很好地涵盖了整个主题(另请参阅 CRAN 上的 AER 包).
- 舒威和斯托弗."时间序列分析及其应用:R 示例" 有多元 ARIMA 模型的例子.
- 哭泣者."时间序列分析:在 R 中的应用"是该主题的经典之作,已更新以包含 R 代码.
- Kleiber and Zeileis. "Applied Econometrics with R" doesn't address this specifically, but it covers the overall subject very well (see also the AER package on CRAN).
- Shumway and Stoffer. "Time Series Analysis and Its Applications: With R Examples" has examples of multivariate ARIMA models.
- Cryer. "Time Series Analysis: With Applications in R" is a classic on the subject, updated to include R code.
这篇关于R中的多元时间序列建模的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!