https://github.com/nixtla logo
#general
Title
# general
c

Christian Ngnie

11/03/2023, 4:45 PM
Hi there, I see the use of exogeneous variables for predictions require knowing their future values, but is there a way to use their lags for predictions when we know they have significant impact in the predictions?
j

José Morales

11/03/2023, 4:57 PM
Hey. You should be able to do that if you want to, you probably just need to change the dates
1
c

Chris Gervais

11/04/2023, 12:27 PM
NF supports both historical and lagged features but I’m not sure if a single column can be in both
c

Christian Ngnie

11/06/2023, 3:19 PM
@José Morales Thanks. But changing the dates is not clear to me. Could you elaborate? Indeed in the data, target and exogeneous variables are in the same range of dates. Moreover I have mathematical guarantees that lagged exogeneous variables impact forecasting. My concern is how to use that in the fitting and then in the forecasting. Thanks
j

José Morales

11/06/2023, 3:19 PM
Which library are you using?
c

Christian Ngnie

11/06/2023, 3:20 PM
Statsforecast and MLforecast. both require having future exogeneous variables
j

José Morales

11/06/2023, 3:24 PM
In statsforecast I think the dates aren't checked, so you can just provide a dataframe with the correct shape, e.g. if you have 10 series and are forecasting 5 periods it should have 50 rows. In mlforecast the dates are checked, so you'd have to offset the dates in your future dataframe so that the first date is the one immediately after your last training date for each serie.
c

Christian Ngnie

11/15/2023, 3:26 PM
Hi @José Morales, quick question. Do Statsforecast and MLforecast handle non-stationary data? if yes how please?
j

José Morales

11/15/2023, 5:03 PM
Hey. In statsforecast it depends on the model, the ARIMA model for example will take differences and seasonal differences to try to make it stationary. In mlforecast you can use target transformations
c

Christian Ngnie

11/15/2023, 5:03 PM
Great Thanks
@José Morales thanks for all these points that you make clear. The package is just a pure magic, it speeds up my forecasting diary task. For the target transformations that you have just clarified, I assume that there is back-transformation when forecasts are done. how is it done? is there any guarantee that it's without bias?
j

José Morales

11/16/2023, 3:22 PM
Hey. To restore the original values we only invert the transformation, e.g. for the standard scaler we multiply by the standard deviation and add back the mean
c

Christian Ngnie

11/16/2023, 4:08 PM
Ok Thanks. I'm asking because I know some simple inverse (like power transform, box_cox not sure for difference) induce bias, that needs to be corrected, in the "original" space. https://robjhyndman.com/hyndsight/backtransforming/ https://github.com/scikit-learn/scikit-learn/issues/15881
j

José Morales

11/16/2023, 4:21 PM
They don't adjust for bias at the moment
although I think those problems only happen with power transformations like boxcox, the other scalers and differences should be fine
1