时间序列预测脚本会返回以下错误:
library(forecast) # version 6.1
myfc = forecast(myts) # see ts object below
Error in decompose(y, type = switch(seasontype, A = "additive", M = "multiplicative")) :
unused argument (type = switch(seasontype, A = "additive", M = "multiplicative"))
我在?forecast
中没有看到相关的参数,所以我不知道这个错误来自哪里。该代码以前工作过,我最近更新了我的所有软件包,因此可能与预测软件包的更改有关。
这里是时间序列对象和sessionInfo():
dput(myts)
structure(c(990145L, 829021L, 999845L, 882279L, 965694L, 984126L,
1096175L, 1042494L, 1019237L, 917413L, 867656L, 974873L, 952704L,
832167L, 900177L, 920919L, 945841L, 1000145L, 1114392L, 980026L,
887912L, 911315L, 841159L, 787133L, 891182L, 809643L, 826410L,
793796L, 856537L, 841324L, 959904L, 954611L, 883759L, 830928L,
862569L, 930569L, 896312L, 793851L, 824419L, 718283L, 835346L,
878511L, 834560L, 890681L, 857262L, 836667L, 747833L, 921598L,
966345L, 858136L, 842052L, 821675L, 865784L, 887827L, 957823L,
898431L, 846662L, 764570L, 774115L, 881166L), .Tsp = c(2009,
2013.91666666667, 12), class = "ts")
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.2 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] forecast_6.1 timeDate_3012.100 zoo_1.7-12
loaded via a namespace (and not attached):
[1] colorspace_1.2-6 parallel_3.2.1 tools_3.2.1 nnet_7.3-10 Rcpp_0.11.6 fracdiff_1.4-2 tseries_0.10-34 grid_3.2.1 lattice_0.20-31 quadprog_1.5-5