robjhyndman / forecast

Forecasting Functions for Time Series and Linear Models
http://pkg.robjhyndman.com/forecast
1.11k stars 341 forks source link

tsCV not accepting other arguments passed to forecastfunction when xreg is present #943

Closed tamas-ferenci closed 1 year ago

tamas-ferenci commented 1 year ago

The tsCV function has an ... argument that is passed to forecastfunction, however, it doesn't seem to work when xreg is provided.

My guess it that the problem is the following: when xreg is not present, ... is passed:

fc <- try(suppressWarnings(
        forecastfunction(y_subset, h = h, ...)
        ), silent = TRUE)

But, interestingly, not when xreg is used:

     fc <- try(suppressWarnings(
       forecastfunction(y_subset, h = h, xreg = xreg_subset, newxreg=xreg_future)
       ), silent = TRUE)
robjhyndman commented 1 year ago

Thanks. Now fixed