ellisp / forecastHybrid

Convenient functions for ensemble forecasts in R combining approaches from the {forecast} package
GNU General Public License v3.0
80 stars 24 forks source link

allow arguments to pass through to auto.arima, ets etc in hybridModel #7

Closed ellisp closed 8 years ago

ellisp commented 8 years ago

probably by

, a.args = list(), e.args = list(), b.args = list(), t.args = list()

dashaub commented 8 years ago

Nice idea. I was considering this yesterday and am also thinking lists are a good way of handling this. Furthermore, we need to consider if we expose shared arguments between models (e.g. lamda) in these lists or with a common argument. If it is in a common argument and the list, the list should take priority over the shared argument to allow the use to pass different values to each model (e.g. lambda is shared by ets, auto.arima, and nnetar while tbats takes use.box.cox. The user should be able to set lambda = 0.5 as an argument for all functions while also setting e.args(lambda = 0.75) and t.args = list(use.box.cox = FALSE) for example).

dashaub commented 8 years ago

This is closed in d2e4b967914debcb4b8223ab81f2b048d053c001 xreg is removed as an argument and now handled in a.args and s.args (e.g. a.args = list(xreg = matrix(rnorm(10, nrow = 5)) lambda remains as an argument but can also be passed in a.args/e.args/n.args/s.args. If it is passed as both an argument and in one of the lists, the more specific list takes priority (for that particular model). For example, hybridModel(rnorm(100), models = "aents", lambda = 0.5, a.args = list(lambda = 0.75), e.args = list(lambda = 0.25) will set lambda to 0.75 for the auto.arima model, 0.25 for the ets model, and 0.5 for the other models (ignored by tbats since tbats merely uses/doesn't use a transform during model selection).