在"失败的尝试"下面我尝试将参数值列表传递给auto.arima,如"正确工作"例。在"失败的尝试" auto.arima似乎忽略除tsdat1之外的所有其他值。
Code:
Tlambda <- 0.9999588
##Working Correctly
fit <- auto.arima(tsdat1, lambda = Tlambda, stepwise=TRUE, approximation = TRUE )
##Failed attempt
Param_List<-c(tsdat1, lambda = Tlambda, stepwise=TRUE, approximation = TRUE)
fit2 <- auto.arima(Param_List)
Data:
dput(tsdat1)
c(0.767202484266145, 2.96949977928183, 2.0671481782824, 3.66022236827445,
1.01872427624301, 0, 4.45424966892274, 2.75619757104319, 1.83011118413722,
1.01872427624301, 1.53440496853229, 1.48474988964091, 0, 1.83011118413722,
2.03744855248601, 0, 1.48474988964091, 0.689049392760799, 1.83011118413722,
0, 3.06880993706458, 0, 1.3780987855216, 1.83011118413722, 0,
0.767202484266145, 4.45424966892274, 0.689049392760799, 3.66022236827445,
1.01872427624301, 3.06880993706458, 1.48474988964091, 1.3780987855216,
0, 4.07489710497203, 1.53440496853229, 4.45424966892274, 2.0671481782824,
16.471000657235, 1.01872427624301, 3.06880993706458, 10.3932492274864,
6.89049392760799, 3.66022236827445, 3.05617282872902, 0.767202484266145,
4.45424966892274, 4.82334574932559, 7.32044473654889, 5.09362138121504,
0.767202484266145, 10.3932492274864, 3.44524696380399, 9.15055592068612,
7.13106993370105, 3.06880993706458, 10.3932492274864, 1.3780987855216,
3.66022236827445, 7.13106993370105, 1.53440496853229, 5.93899955856366,
4.13429635656479, 9.15055592068612, 6.11234565745804, 0.767202484266145,
4.45424966892274, 2.0671481782824, 3.66022236827445, 5.09362138121504,
3.83601242133072, 4.45424966892274, 2.0671481782824, 7.32044473654889,
7.13106993370105, 4.60321490559687, 7.42374944820457, 6.20144453484719,
7.32044473654889, 4.07489710497203, 1.53440496853229, 5.93899955856366,
2.75619757104319, 5.49033355241167, 4.07489710497203, 1.53440496853229,
5.93899955856366, 1.3780987855216, 1.83011118413722, 5.09362138121504,
1.53440496853229, 2.96949977928183, 2.0671481782824, 7.32044473654889,
3.05617282872902, 2.30160745279843, 8.90849933784549, 0, 3.66022236827445,
1.01872427624301)
答案 0 :(得分:1)
如果要将参数作为列表传递,请使用do.call
。
Param_List <- list(y=tsdat1, lambda = Tlambda, stepwise=TRUE, approximation = TRUE)
fit2 <- do.call(auto.arima, args=Param_List)
答案 1 :(得分:0)
你可以这样做:
Param_List<-list(x=tsdat1, lambda = Tlambda, stepwise=TRUE, approximation = TRUE)
fit2 <- auto.arima(x=Param_List$x, lambda = Param_List$lambda, stepwise=Param_List$stepwise, approximation = Param_List$approximation)
我不知道是否存在更漂亮的解决方案,不过