2016-06-05 7 views
0

Ich versuche, auto.arima Funktion zu verwenden, aber es funktioniert nicht richtig. Der Code (bearbeitet):Schlechte Ergebnisse mit auto.arima

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)) 

Und die Ergebnisse sind Unsinn:

14 steps predition

Was mache ich falsch?

+1

Sie sollten ein funktionierendes Beispiel für 'aux_data' bieten. –

+0

@PierreLafortune Wie teilen Sie normalerweise Dateien hier im Stackoverflow? Vielen Dank. – mvillegas

+0

Teilen Sie die Datei nicht. Fügen Sie einfach einen Teil des Datenrahmens zur Frage 'head (aux_data, 20)' –

Antwort

2

Dies ist ein Beispiel, wo auto.arima eine schlechte Wahl über die saisonale Differenzierung macht. (Ein Problem, das auf meiner Liste zu tun ist: http://robjhyndman.com/hyndsight/forecast7-part-2/)

können Sie bessere Ergebnisse wie folgt:

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

enter image description here