1
$\begingroup$

I will use an extremely simplified example to ilustrate the question, but I think the answer shsould hold for more generalised cases.

Let's say I want to create a time series regression model (the model itself is not relevant as the question is related to the information present in the data) to predict a target variable (sales).

To do so, I have the historical data and, additionally, a regressor variable which I know explains some of the variability of the target variable. (A typical case is some Weather indicator)

The problem is, I only have data until the current period of time, and I'm interested in the prediction two time steps ahead.

What whould be the best way to incorporate this information into the model?

Dummy example The data:

enter image description here

The objective is to predict Sales for t+2, and we assume Weather has some degree of covariance with Sales

Possible approaches:

  1. Train up to t0 using weather and then forecast Weather forward with another model and use it to predict with the trained model - In this case the forecast error of the Weather variable will impact directly the final prediction, as the model will be trained with quality real data and the prediction with low quality forecasted data
  2. Train model using lagged (in this case Lag2) Weather - In this case Lag2 Weather might not explain the target variance as well as the non-lagged variable
  3. For each timestep, use Weather up to t-(i-2) to forecast X-i and train the model using these values.
  4. Not use Weather data at all - Loss of potentially useful information
  5. Other approaches

EDIT: The auto review says the question might be subjective, but I think not. The answer should be general and take into account the forecasted Weather can be of good/bad quality and Lag2 Weather can retain a lot/very little information

$\endgroup$

1 Answer 1

0
$\begingroup$

This question is not subjective but it is "domain-specific" because how you would use the additional predictor depends on the predictor itself.

Let's stay within your given example, first we have to answer some basic questions about the use case:

1. How far ahead do you need to predict?

E.g. if you need want to make short-term predictions like 2-3 days ahead max then feature engineering is likely the best way to go. It is quite easy to parse several weather forecasts (most even offer APIs) and use that data. You are right that we then have to cope with the prediction quality of the weather but a) we expect prediction quality for short-term weather forecast to be quite good and b) if possible we could tune our model somewhat to it by using "predicted weather" instead of actual weather in our model training.

If you want to do long-term prediction this might not work out as long-term weather is notoriously hard to predict.

2. How important is the predictor to your model?

Leaving out a predictor that simply isn't available might be the best solution especially if that predictor does not have a lot of predictive power. At face value this might sting but it is no different than realizing that many other predictors are unusable for any given case even if they would be valuable. So unless your model absolutely does not work without weather as a predictor, giving up on this part and finding other predictors might be smart.

3. How stable is the time series of the predictor?

In terms of feature engineering you already talked about using a lag approach to use historical weather. Well we could go ahead and use a time-series approach to forecast weather ourselves (which is different from using proper weather forecast models which you are unable to be able to build). This does make sense any time the time series of the predictor is more stable than the time series of the outcome variable. Directly using lagged values does not make a lot of sense because that would be basically just an inferior time series model, so directly go for something like ARIMA / Prohpet, etc.

Basically you already summed up most of the viable approaches yourself:

  1. Not using the predictor

  2. Engineering a replacement

  3. Forecasting the predictor

Which one of these is the most sensible and viable depends on the specific use case. There is no one answer to that.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.