3

I am trying to do time series analysis in R. I have data time series data set like this.

    Month       Year    Value 
    December    2013    5300
    January     2014    289329.8
    February    2014    596518
    March       2014    328457
    April       2014    459600
    May         2014    391356
    June        2014    406288
    July        2014    644339
    August      2014    251238
    September   2014    386466.5
    October     2014    459792
    November    2014    641724
    December    2014    399831
    January     2015    210759
    February    2015    121690
    March       2015    280070
    April       2015    41336

Googling I found I can use auto.arima function to forecast the result. I managed to write R code to do forecast using auto.arima function

    data <- c(5300,289329.8,596518,328457,459600,391356,406288,644339,251238,386466.5,459792,641724,399831,210759,121690,280070,41336)
    data.ts <- ts(data, start=c(2013, 12), end=c(2015, 4), frequency=12) 
    plot(data.ts)
    fit <- auto.arima(data.ts)
    forec <- forecast(fit)
    plot(forec)

Problem is my forecast result always remain same.

enter image description here

Could any tell me what is going wrong. or help me to correct my forecast result. Thanks

shakthydoss
  • 389
  • 1
  • 4
  • 19
  • 1
    You specified a `frequency` of 12, but you don't have even two complete periods, how is `auto.arima` supposed to capture that? – David Arenburg Apr 20 '15 at 09:19

1 Answers1

6

auto.arima() believes the best model (as per its default criterion, AICc) is an ARIMA(0,0,0) model with non-zero mean. That is, a pure intercept model with no autoregressive terms, no moving average terms and no integration. So your forecast is simply the historical average.

Looking at your historical data, it is hard to say anything else should do a better job. You don't have enough data to assess seasonality. You don't have a trend. You don't have obvious AR or MA behavior. (If you want to, you can look at ACF and PACF plots, but I doubt that will show anything auto.arima() did not pick up on.)

And yes, a constant mean forecast can certainly outperform a (nonconstant) ARIMA forecast, and frequently will do so.

Stephan Kolassa
  • 95,027
  • 13
  • 197
  • 357