do.call BoxCox错误

时间:2016-11-14 05:26:46

标签: r time-series forecasting do.call

我正在尝试使用下面的代码行计算几个BoxCox lambda参数,以获取几个时间序列的列表。我收到以下错误。我试过谷歌搜索错误没有运气,如果有人可以请指出问题,我将不胜感激。

Code:
testRun<-do.call(BoxCox.lambda, args=ListData)

Error in (function (x, method = c("guerrero", "loglik"), lower = -1, upper = 2)  : 
  unused arguments (c(310, 221.5, 215, 158, NA, NA, 255, 150.5, 126, 211, 164.5, NA, NA, 310, 216, NA, NA, 184, 149, NA, 308, NA, 221, NA, NA, 258, 310, 310, 119, 123, 101.5, NA, 81, NA, 182.5, 70.5, 138.5, 310, 188, 26, 185, 310, 310, 275, 250, 240, 186, 212, 304, 212), c(38, 3, 11, 9, NA, NA, 33, 64, 1, 28, 10.5, NA, NA, 2, NA, NA, 8, 4, 10, NA, 2, NA, NA, NA, NA, 10, 24, NA, 1, NA, NA, NA, NA, NA, 1, 1, 1, 1, 1.5, NA, 2, 4, 2, 86, 86, 2, 86, 86, 1, 86), c(0, 10.5, 22, 11, NA, NA, 19, 21, 20, 15, 15.5, NA, 
NA, 35, 29.5, NA, NA, 35, 11, NA, 35, NA, 11, NA, NA, 0, 12, 35, 26.5, 15, 22.5, NA, 6.5, NA, 10, 9.5, 22.5, 13, 23, 4, 14, 13, 12.5, 24, 0, 35, 10, 30, 17, 21), c(NA, NA, NA, NA, 0, NA, NA, NA, NA, NA, NA, 36.5, NA, NA, NA, NA, 99, NA, NA, NA, 92, NA, 99, 98, NA, NA, NA, NA, NA, NA, NA, 0, NA, NA, NA, NA, 99, NA, 0, NA, NA, NA, 46, NA, NA, NA, 76, NA, NA, 78))

Data:
dput(ListData)
list(c(6, 15.5, 22, 16, NA, NA, 13, 13.5, 10, 6, 14.5, 16, NA, 
8, 11, NA, 2, 2, 10, NA, 9, NA, 11, 16, NA, 4, 17, 7, 11.5, 22, 
20.5, 10, 22, NA, 13, 17, 22, 9, 13, 19, 8, 16, 18, 22, 21, 14, 
7, 20, 21.5, 17), c(11, 4, 8, 11, 11, NA, 3, 2.5, 6, 11, 7, 1, 
NA, 6, 6, NA, 6, 11, 3, NA, 11, NA, 10, 10, NA, NA, 9, 3, 3, 
11, 8, 10, NA, NA, 11, 10, 9, 3, 7, NA, 2, 4, 11, 2.5, 3, NA, 
4, 7, 1, 5), c(33, 11, 33, 3, 12, NA, 8, 20.5, 17, 33, 22.5, 
2, NA, 16, 11, NA, 16, 28, 23, NA, 25, NA, 10, 11, NA, 12, 12, 
5, 12.5, 33, 17.5, 13, 9, NA, 22, 29, 21, 3, 7, 6, 2, 17.5, 33, 
33, 5.5, 5, 33, 8, 21.5, 5), c(337, 211, 194, 90, 337, NA, 236, 
129.5, 106, 196, 149, 225.5, NA, 302, 186.5, NA, 273, 147, 138, 
NA, 216, NA, 233.5, 123, NA, 259, 188, 323, 91, 108, 63.5, 337, 
88.5, NA, 38, 61, 148, 328, 219.5, 22, 176, 296.5, 280, 282, 
337, 170, 337, 302, 246, 289), c(310, 221.5, 215, 158, NA, NA, 
255, 150.5, 126, 211, 164.5, NA, NA, 310, 216, NA, NA, 184, 149, 
NA, 308, NA, 221, NA, NA, 258, 310, 310, 119, 123, 101.5, NA, 
81, NA, 182.5, 70.5, 138.5, 310, 188, 26, 185, 310, 310, 275, 
250, 240, 186, 212, 304, 212), c(38, 3, 11, 9, NA, NA, 33, 64, 
1, 28, 10.5, NA, NA, 2, NA, NA, 8, 4, 10, NA, 2, NA, NA, NA, 
NA, 10, 24, NA, 1, NA, NA, NA, NA, NA, 1, 1, 1, 1, 1.5, NA, 2, 
4, 2, 86, 86, 2, 86, 86, 1, 86), c(0, 10.5, 22, 11, NA, NA, 19, 
21, 20, 15, 15.5, NA, NA, 35, 29.5, NA, NA, 35, 11, NA, 35, NA, 
11, NA, NA, 0, 12, 35, 26.5, 15, 22.5, NA, 6.5, NA, 10, 9.5, 
22.5, 13, 23, 4, 14, 13, 12.5, 24, 0, 35, 10, 30, 17, 21), c(NA, 
NA, NA, NA, 0, NA, NA, NA, NA, NA, NA, 36.5, NA, NA, NA, NA, 
99, NA, NA, NA, 92, NA, 99, 98, NA, NA, NA, NA, NA, NA, NA, 0, 
NA, NA, NA, NA, 99, NA, 0, NA, NA, NA, 46, NA, NA, NA, 76, NA, 
NA, 78))

1 个答案:

答案 0 :(得分:0)

postgresdo.call参数视为对第一个参数的单个调用的参数。

据推测,你想要这样的东西:

args

但是,缺失值会给您带来问题。在调用testRun <- lapply(ListData, BoxCox.lambda) 之前,您可能想要估算它们。

BoxCox.lambda