2
$\begingroup$

I have a time series data (1 minute and sometimes 5 minute data) data I would like use forecasting package to forecast couple hours ahead.

Here is my data:

dput(head(p,20))
structure(list(time = structure(c(1373889420, 1373889480, 1373889540, 
1373889600, 1373889660, 1373889720, 1373889780, 1373889840, 1373889900, 
1373889960, 1373890020, 1373890080, 1373890140, 1373890200, 1373890260, 
1373890320, 1373890380, 1373890440, 1373890500, 1373890560), class = c("POSIXct", 
"POSIXt"), tzone = "America/New_York"), cpu = c(2.25892, 2.04144, 
5.04823333333333, 4.9947, 1.72982857142857, 4.82655, 3.6168625, 
4.7357, 2.42683333333333, 3.62635, 5.02315714285714, 2.57147142857143, 
7.16005, 2.34253333333333, 2.82315714285714, 5.17668, 2.2899375, 
6.92, 5.172375, 4.63735), name = c("servers", "servers", "servers", 
"servers", "servers", "servers", "servers", "servers", "servers", 
"servers", "servers", "servers", "servers", "servers", "servers", 
"servers", "servers", "servers", "servers", "servers")), .Names = c("time", 
"cpu", "name"), row.names = c(1116L, 1411L, 123L, 226L, 1014L, 
435L, 538L, 569L, 1081L, 342L, 74L, 865L, 178L, 890L, 281L, 166L, 
1035L, 143L, 112L, 91L), class = "data.frame")

x.xts <- xts(p$cpu, p$time)
x.ts <- as.ts(x.xts)
x.ets <- ets(x.ts)
x.fore <- forecast(x.ets, h=120)
f<-data.frame(x.fore$mean)
    DateTime<-tail(z,1)$time
f$DATE <- DateTime + 60 * (seq_len(nrow(f))-1)
    colnames(f)<-c("cpu", "time")
    f$name<-c("forecast")

I see that cpu is the same for all future data times:

 cpu                time     name
1 6.020207 2013-07-15 11:57:00 forecast
2 6.020207 2013-07-15 11:58:00 forecast
3 6.020207 2013-07-15 11:59:00 forecast
4 6.020207 2013-07-15 12:00:00 forecast
5 6.020207 2013-07-15 12:01:00 forecast
6 6.020207 2013-07-15 12:02:00 forecast

Is there a better forecasting model besides ets for time series data?

$\endgroup$
2
$\begingroup$

Yes, this looks good. There is no pattern within the data to be extracted. It is all "noise" so a flat forecast is fine.

Now, if you want to correct for the two outliers at period 13 and 18 then no it wouldn't be good. Are these outliers?? Also, do you have any causal variables that explain the Y?

$\endgroup$
  • $\begingroup$ what model would you chose to forecast data points like this, etc, holtwinters, arima? $\endgroup$ – user1471980 Jul 15 '13 at 17:36
  • $\begingroup$ How can I answer your questions when you don't answer mine? Are those two data points outliers??? To answer yours, I don't agree with using a specific model and forcing it to the data. would you borrow a friends glasses and try and see with them? No. I believe in using heuristics to use the ACF/PACF to identify patterns from the noise. ETS doesn't do this for you. $\endgroup$ – Tom Reilly Jul 15 '13 at 18:03
  • $\begingroup$ yes, those data points are outliers. I need to script this, within script I could pick ets, arima, holtwinters. My question is which one of these models is best suited for time series data. $\endgroup$ – user1471980 Jul 15 '13 at 18:26
  • $\begingroup$ There is no one model to use. You have a make or buy decision. We have software that detects the outliers at period 13 and 18 and doesn't assume a model form. Go to www.autobox.com for more Y(T) = 3.6301 + 3.2899 :PULSE 2007 + 3.5299 :PULSE 2002 $\endgroup$ – Tom Reilly Jul 15 '13 at 19:22
  • $\begingroup$ FYI:The forecast would be 3.63 vs 6.02 from ets. $\endgroup$ – Tom Reilly Jul 15 '13 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.