Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
Forecasting with (linear) Regression - Find best Time Lag of Parameters
christian_langm
Member, University Professor Posts: 3 University Professor
Dear community,
I am struggling with a (probably) basic question for a model. I have a forecasting model for sales. I use various independent variables such as sales rep visits, incoming call center calls etc. to predict sales with a linear regression. So far no problem.
Depending on the sales cycle of a business the visit of a sales rep might turn into a sales/revenue one, two or three months later. Now, this is where I am struggling. Basically, I am looking for an algorithm that tells me which time lag (t=-1, t=-2, t=-3 etc.) of a independent variable is best to predict the sales in t=0.
Does anyone have hint for me?
Many thanks!
Chris
I am struggling with a (probably) basic question for a model. I have a forecasting model for sales. I use various independent variables such as sales rep visits, incoming call center calls etc. to predict sales with a linear regression. So far no problem.
Depending on the sales cycle of a business the visit of a sales rep might turn into a sales/revenue one, two or three months later. Now, this is where I am struggling. Basically, I am looking for an algorithm that tells me which time lag (t=-1, t=-2, t=-3 etc.) of a independent variable is best to predict the sales in t=0.
Does anyone have hint for me?
Many thanks!
Chris
Tagged:
0
Best Answer
-
christian_langm Member, University Professor Posts: 3 University ProfessorMany, many thanks for the responses!
Looking at the correlation matrix to identify different models was also my first idea. However, I am looking for a way to automatically set-up the different models and test them, i.e. without me modeling everyone of them in advance. Imagine if you have 8-10 parameters, different possible time lags and all the combinations. That would not really be convenient.
By chance: do you have an example of the sliding window operator for sales forecasting, maybe even with a loop parameter?
Best,
Chris
1
Answers
You can have a look at the autocorrelation between the sales at t=0 and the independent variables to evaluate if there is a high correlation for a specific lag. Also you can setup up a validation scheme by using the Sliding Window Validation operator (or the Forecast Validation operator if you are working with classic forecast models). You built your different models (with different lags) on the training windows and evaluates their prediction performance on the testing windows. Thus you can compare the prediction performance between the different models (with different lags).
Hopes this helps,
Best regards,
Fabian
Took me a bit of time to come back to this. Below you can find a demo process to perform such an optimization of different parameters with Sliding Window Validations.
I used the Gas Prices demo data set inside RapidMiner for demonstration purposes. Note that the execution takes a few moments (for me 20 sec, and I looped only over a few combinations). This is due to the number of iterations in the Sliding Window Validation and the size of the input ExampleSet.
I looped over the window size of the Windowing operator (which is the 'lag' used in this example). I also combined this with looping over the use_bias parameter of the linear regression to demonstrate how to combine different parameter optimization in the one Optimization operator.
Hopes this helps,
Best regards,
Fabian
many thanks. After getting done some other things on my table, I can finally look into it tomorrow.
Thank you for your effort! I will get back after I tried it out.