1
$\begingroup$

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:

table snippet here

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:

table snippet here

What should be my approach for this problem?

Please help me out here. Thank you for your time and support in advance. I am sorry if my documentation or question is poor.

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – Stereo Oct 2 '16 at 20:44
  • $\begingroup$ 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. $\endgroup$ – Spacedman Oct 7 '16 at 7:42
3
$\begingroup$

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.

| improve this answer | |
$\endgroup$
1
$\begingroup$

As others have mentioned, the more information the better.

However, assuming that you need to explain the forecast to other, non-technical individuals, I would recommend an Exponential Weighted Moving Average. In short, the EWMA will give higher weight to more recent historical sales.

I've attached some R examples to highlight exponential smoothing

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ EWMA with three data points in each time series? I suppose maybe you could pool all the series and perhaps get a fair estimate of a single parameter. But I suspect the exponential weighing will either end up with effectively year_4 = year_3 or maybe year_4 = mean(years 1 to 3). $\endgroup$ – Spacedman Oct 7 '16 at 7:39
  • $\begingroup$ @Spacedman agreed - there is insufficient data to begin with. I would suggest that the OP aggregate more information $\endgroup$ – jonplaca Oct 7 '16 at 13:51
-2
$\begingroup$
  1. To generate a forecast more accurately for the next year given past 3 years of history, you will need more granular data. At least monthly sales, so that the forecast can capture trend and/seasonality. With three data points, you will at best be able to generate a moving average forecast. Which isn't very good. If you have more granular data, use the forecast package in R. The forecast() function will pick the best method based on the time series pattern. You don't need to worry about stationarity or heteroscedasticity either.

  2. For new products, you have two options. Explore diffusion curves such as Bass. Or, base the forecast curve on previous new product launches if there are shared attributes with existing products. If it's a brand new product line, evaluate market trends to generate the forecast. New product forecasting is a very difficult problem as such.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ If the poster had finer grained data that should have told us, or this should be a comment not a question. Ditto if there were other attributes to the data. Please use the comments on questions for things that aren't answering the question. $\endgroup$ – Spacedman Oct 7 '16 at 7:35

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.