【发布时间】:2021-02-08 00:07:12
【问题描述】:
当我尝试在 R 中调整我的季度时间序列数据集以适应季节性时遇到问题。我已将数据集“ASPUS”加载到 R 并使用以下代码指定它的日期:
ASPUS <- read.csv(file = "ASPUS.csv", header=TRUE, sep=",")
ASPUS$DATE <- as.Date(ASPUS$DATE, "%Y-%m-%d")
数据集的头部如下所示:
DATE ASPUS
1 1963-01-01 100.00000
2 1963-04-01 100.51813
3 1963-07-01 99.48187
4 1963-10-01 101.55440
5 1964-01-01 101.55440
数据集的目的是将其作为时间序列进行分析。因此,我使用 ts 函数来创建时间序列对象:
ASPUSts <- ts(ASPUS, frequency = 4, start = 1963)
但是,此函数在日期列中返回负数,如下所示:
DATE ASPUS
1963 Q1 -2557 100.00000
1963 Q2 -2467 100.51813
1963 Q3 -2376 99.48187
1963 Q4 -2284 101.55440
1964 Q1 -2192 101.55440
1964 Q2 -2101 104.66321
我的问题出现在下一步,我尝试使用 seas 函数调整季节性:
ASPUS1 <- seas(ASPUSts)
因为我收到此错误:
Error: X-13 run failed
Errors:
- Seasonal MA polynomial with initial parameters is
noninvertible with root(s) inside the unit circle. RESPECIFY
model with different initial parameters.
Warnings:
- Automatic transformation selection cannot be done on a series
with zero or negative values.
- The covariance matrix of the ARMA parameters is singular, so
the standard errors and the correlation matrix of the ARMA
parameters will not be printed out.
- The covariance matrix of the ARMA parameters is singular, so
the standard errors and the correlation matrix of the ARMA
parameters will not be printed out.
是否有人对我如何处理这些负值或以其他方式解决问题有任何建议,以便我可以对我的数据集进行季节性调整?
【问题讨论】:
标签: r time-series