简体   繁体   中英

Bad results using auto.arima

Im trying to use auto.arima function but it is not working properly. The code (edited):

dummydata <- c(-1.55993917397658, -1.17458854064119, -0.172676893969176, -0.301127105080973,
....
)
# Full data at http://pastebin.com/V93K30zG
aux_data <- ts(data = dummydata, frequency = 7)
plot(x=1:413, y=aux_data, type='l', xlim=c(1,440), ylim=c(-4,3))
# ARIMA
best_arima <- auto.arima(aux_data, ic="bic", allowdrift = FALSE)
# aux_pred <- predict(best_arima, n.ahead=14)
aux_pred <- forecast(best_arima, h=14)
pred_data <- aux_pred$mean
par(new=TRUE)
plot(x=c(414:427), y=pred_data, type='l', col="red", xlim=c(1,440), ylim=c(-4,3))

And the results are nonsense:

14步掠夺

What am I doing wrongly?

This is an example where auto.arima makes a bad choice about the seasonal differencing. (A problem which is on my to do list: http://robjhyndman.com/hyndsight/forecast7-part-2/ )

You can get better results as follows:

best_arima <- auto.arima(aux_data, D=1)
aux_pred <- forecast(best_arima, h=14)
plot(aux_pred, plot.conf=FALSE, fcol='red')

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM