I need to build a model using climate variables (temperature, rainfall) to predict monthly sales (horizon of 6 months) for certain product. The data has strong seasonality and a standard regression model would works fine, the problem is that the historic data will not be updated, meaning that the observed data points will not be incorporated into the model.

Whats a good way to solve this? What if i split the sales data into levels (say 'WEAK', 'NORMAL', 'HIGH', VERY HIGH') and then use a regression tree? Is there any 'danger' in doing this?

For a standard regression model, how i deal with the seasonality if the new points will not be incorporated?

I'm using R, thanks!

  • $\begingroup$ What do you mean by "the historic data will not be updated"? In addition, are you sure that temperature and rainfall are more important than promotions, marketing and price changes? $\endgroup$ Dec 21, 2012 at 16:09
  • $\begingroup$ It's a 6 month forecast, so after the first month pass by the observed value (what occurred) will not be appended to the data. That's the problem: i need seasonality to take care of these variations that you mentioned. $\endgroup$
    – Fernando
    Dec 21, 2012 at 16:17

1 Answer 1


Given that you have monthly data, you can model the seasonality using dummy variables, e.g.:

foo <- data.frame(sales=rnorm(48,10,10),
model <- lm(sales~month,data=foo)

However, a more common approach would be to use seasonal exponential smoothing. See, e.g., here.

And I think that your weather data will be completely useless: with monthly data, temperature and rainfall will be collinear with the month dummies, and weather simply varies too much within months. In particular: for a six-month ahead forecast you would need to forecast temperature and rainfall also for six months ahead, which is probably not possible to get better than "it will be June, so it will probably be warmer than today".

  • $\begingroup$ That's a good point, 6 months climate forecast is too much ahead! Anyway, if a build a decision tree, should i include the months as well? $\endgroup$
    – Fernando
    Dec 21, 2012 at 18:00
  • $\begingroup$ Given that you say that your data is strongly seasonal, you should definitely include month dummies if you decide to go with a regression tree. However, you really don't want to classify, you want to forecast... and a tree would not be my first choice to do so. $\endgroup$ Dec 21, 2012 at 18:23
  • $\begingroup$ You regression will always give the same results in my case: the historic data will not be updated, that's why i need predictors. Is there a problem(regarding forecast performance) if i build a model with seasonal dummy + predictors? thanks $\endgroup$
    – Fernando
    Dec 21, 2012 at 18:36
  • $\begingroup$ A regression will work just fine with causal predictors. You will just need to be careful that you don't over-parameterize your model if you only have a short history. $\endgroup$ Dec 21, 2012 at 18:42
  • $\begingroup$ But what kind of test i can perform to choose between only seasonal OR seasonal + predictors? $\endgroup$
    – Fernando
    Dec 21, 2012 at 18:51

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.