Get startedGet started for free

Transfer functions & ensembling

1. Transfer Functions & Ensembling

Now it is time to combine everything we have learned so far! Two ways of approaching this is through transfer functions or ensembling.

2. Combining Techniques

There are multiple ways to try and combine different techniques for forecasting. Two common ways of doing this is to combine everything mathematically into one model - called transfer functions. Another common way to do this would be to "average" the forecasts coming out of multiple models - called ensembling.

3. Combining Techniques - Transfer Functions

We have now looked at each piece of the demand prediction and talked about a modeling technique for each - regression for the drivers of demand, and time series for the errors at the end.

4. Combining Forecasts

Now the forecast is receiveing information from both external sources and drivers of demand as well as residual effects that can be coming in through time.

5. Mathematics in the Background

The first step we do is to build the regression model as you see in the first equation. We have log of our target (demand) and use the log of X (price) as well as any other drivers we want to predict demand. From there we isolate the residuals to build a time series model as you see here in the second equation. We can essentially combine the forecasts together mathematically!

6. Transfer Function Example

Let's go ahead and try this out in R. First, we need to take our forecasts from the residual ARIMA model and exponentiate them. From there we multiple our two forecasts together like we saw in the previous slides. Let's see how good we did by first subsetting out the validation data set and then calculating the MAE and MAPE. MAPE of 13.45%. Not quite as good as our previous model without the residual ARIMA.

7. Combining Forecasts - Ensembling

Ensembling on the other hand doesn't combine the approaches, but combines the forecasts themselves. There are a variety of ways of blending the forecasts together, but we are just going to go the easy route - take the average of the forecasts. By averaging our forecasts we are trying to still get the value from both techniques, but just not trying to combine them together in the estimation phase - just the forecasting part. However, we are not going to average the regression forecast with the residual ARIMA model. The residual ARIMA model isn't predicting the same thing as the regression model. We are going to need a time series forecast of the demand itself! Back to what we learned in chapter 1!

8. Time Series for Demand

Here we are going to build a time series model directly for demand of the high end product in the mountain region. Looks like we have four AR terms and two MA terms.

9. Time Series for Demand

Let's get an idea of how good this time series model is all by itself. MAPE of 16.29% isn't as good as our previous one.

10. Ensembling Example

Now let's ensemble our forecasts together! Here we are just going to take the simple average of our two forecasts. Looking at the MAE and MAPE shows that although ensembling was an improvement over time series alone, it wasn't an improvement over the regression alone. You may be thinking this should always be the case, but that isn't true. The reason we ensemble is to try and get the best of both. We are hoping that if one overpredicts demand and one underpredicts demand then averaging them will help. This doesn't appear to be the case here.

11. Let's practice!

Now it's time for you to try!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.