-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
Description
Currently forecast.hybridModel() issues a warning if the xreg was only used for one component model and not the others. This behavior could be kept, but more flexibility would be given by allowing forecast.hybridModel() to accept individual xreg arguments in a.xreg and n.xreg the same way a.args and n.args can be used with hybridModel(). This leads to more verbose function calls, but it is certainly conceivable that a user would want to use different xregs (e.g. fourier terms for seasonality) in different models. Scratchpad code below for demonstrating current xreg usage:
library(forecastHybrid)
dat <- wineind
set.seed(12354)
# Test 1
m <- matrix(rnorm(length(dat)), ncol = 1)
mm <- matrix(rnorm(2 * length(dat)), ncol = 2)
a1 <- auto.arima(dat, xreg = m)
h1 <- hybridModel(dat, a.args = list(xreg = m))
a1
h1$auto.arima
forecast(a1, xreg = m)$mean == forecast(h1, xreg = m)$auto.arima$mean
# Test 2
a2 <- auto.arima(dat, xreg = mm)
h2 <- hybridModel(dat, a.args = list(xreg = data.frame(mm)))
a2
h2$auto.arima
forecast(a2, xreg = mm)$mean == forecast(h2, xreg = mm)$auto.arima$mean