4 Answers
4

In general, dig into an advanced time series analysis textbook (introductory books will usually direct you to just trust your software), like Time Series Analysis by Box, Jenkins & Reinsel. You may also find details on the Box-Jenkins procedure by googling. Note that there are other approaches than Box-Jenkins, e.g., AIC-based ones.

In R, you first convert your data into a ts (time series) object and tell R that the frequency is 12 (monthly data):

See ?auto.arima for help. As we see, auto.arima chooses a simple (0,0,0) model, since it sees neither trend nor seasonality nor AR or MA in your data. Finally, you can forecast and plot the time series and forecast:

Hi Stephan, I have added the data and the plot for my dataset. As you can see that I have only 27 data points, so I am running on fumes here. Could you suggest something here.
–
Raunak87Jun 26 '14 at 6:43

I edited the answer. Your series does not exhibit a lot of structure, so there is really little you can do. Since you essentially have noise and little else, you get large prediction intervals.
–
Stephan KolassaJun 26 '14 at 6:53

Two things.Your time series is monthly,you need at least 4 years of data for a sensible ARIMA estimation, as reflected 27 points do not give the autocorrelation structure. This can also mean that your sales is affected by some external factors , rather than being correlated with its own value. Try to find out what factor affects your sales and is that factor being measured. Then you can run a regression or VAR (Vector Autoregression) to get forecasts.

If you absolutely don't have anything else other than these values , your best way is to use a exponential smoothing method to get a naive forecast. Exponential smoothing is available in R .

Secondly don't see the sales of a product in isolation, the sales of two products might be correlated for example increase in coffee sales can reflect decrease in tea sales. use the other product information to improve your forecast.

This typically happens with sales data in retail or supply chain. They dont show much of autocorrelation structure in the series. While on the other hand methods like ARIMA or GARCH typically work with stock market data or economic indices where you generally have autocorrelation.

This is really a comment but exceeds the allowable so I post it as a quasi-answer as it suggests the correct way to analyze time series data. .

The well-known fact but often ignored here and elsewhere is that the theoretical ACF/PACF which is used to formulate a tentative ARIMA model premises no Pulses/Level Shifts/Seasonal Pulses/Local Time Trends. Additionally it premises constant parameters and constant error variance over time. In this case the 21st observation (value=158) is easily flagged as an outlier/Pulse and a suggested adjustment of -80 yields a modified value of 78 . The resultant ACF/PACF of the modified series shows little or no evidence of stochastic (ARIMA) structure. In this case the operation was a success but the patient died. The sample ACF is based upon the covariance/variance and an unduly inflated/bloated variance yields a downwards bias to the ACF. Prof. Keith Ord once referred to this as the "Alice in Wonderland effect"

As it has been pointed out by Stephan Kolassa there is no much structure in your data. The autocorrelation functions do not suggest an ARMA structure (see acf(sales), pacf(sales)) and forecast::auto.arima does not choose any AR or MA order.

Aside note: JarqueBera.test is based on function jarque.bera.test available in package tseries.

Including the additive outlier at observation 21 that is detected with tsoutliers renders normality in the residuals. Thus, the estimate of the intercept and the forecast are not affected by the outlying observation.

It doesn't make sense to use a Jarque Bera test with $n=12$, since (i) it relies on an asymptotic approximation that doesn't kick in until $n$ is well into the hundreds, and (ii) a formal hypothesis test really answers the wrong question (we know the data won't be exactly normal; the question is really how badly we might be affected by potential non-normality, which the test doesn't speak to.
–
Glen_b♦Jun 26 '14 at 9:27