0

我正在尝试使用 tsDyn 包在“r”中运行阈值自回归模型。

我在“r”中运行了以下命令:

Tar <- TVAR(spread, lag=1, include = c("both"), model = ("TAR"), thDelay = 1, trim=0.1, mTh = 1, plot=TRUE)

我收到以下错误消息:

Error in `colnames<-`(`*tmp*`, value = list(Bdown = NULL, Bup = NULL)) : 

length of 'dimnames' [2] not equal to array extent

我的时间序列对象如下所示:

 > spread
           Qtr1       Qtr2       Qtr3       Qtr4
1973 0.06288020 0.06291441 0.06775660 0.06782501
1974 0.07044100 0.07100951 0.07721481 0.08238591
1975 0.08007791 0.07509880 0.07085930 0.07079081
1976 0.07589350 0.07920151 0.07823570 0.08212550
1977 0.08212750 0.08140471 0.07599191 0.07942870
...

根据请求编辑:

    > str(spread)
 Time-Series [1:175, 1] from 1973 to 2016: 0.0629 0.0629 0.0678 0.0678 0.0704 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr "udlån"

我不明白错误消息或我能做些什么来修复它?

我非常感谢任何帮助。

此致

拉斯穆斯·达姆加德

4

0 回答 0