# Forecasting sales of next year using sales of past years?

I have a dataset of sales of a company for different products throughout 3 years. I have to forecast the sales for each of these products for next year. A sample of the dataset is:

Here I have to forecast sales for year 4 from the sales record of each product over 3 years.

N.A is present where the particular product was not sold in that year.

Questions

1.Which algorithm should I use to forecast the sales for year 4? I have heard about ARIMA and xgboost being used for time series data. Can you please help me with that?

2.Now I am being given a new product which was not sold before. I am being asked to predict its sales for year 4, using the data for sales of other products:

What should be my approach for this problem?

• Could you show us some code that you have tried? To be honest neither ARIMA or xgboost will do you much good with this little data. Commented Oct 2, 2016 at 20:44
• Do you have any other attributes about the products? Like what sort of thing they are, what colour they are, how much they cost? Anything apart from a one-letter "Product" code? Because without that your best bet for part 2 is probably just going to be an average of all the other products sales. Commented Oct 7, 2016 at 7:42

If you have daily data you could create a dummy time calendar, i.e. you create a dummy variable for each day of the week and include your company's promotions for each product, Christmas, Easter, public holidays. Then use autoarima() or nnetar() (or combine them) to forecast the time horizon you want. This link is a good example.

Another possible way to do that is to use the method of following paper: "Hsiang-Fu Yu, Nikhil Rao, and Inderjit S. Dhillon. 2015. Temporal Regularized Matrix Factorization. CoRR abs/1509.08333 (2015)" This paper can help you with with forecasting the new products too.

Or for forecasting new products you could find a comparable products from your historical data then use those comparables' sales data to forecast performance of the new ones.

If your data really looks like above I think you could use Hsiang-fu's paper. this is a good approach.

For autoregressive forecasting you could read from Rob Hyndman's blog.