fabletools
fabletools copied to clipboard
Calculation of combination weights in the combination_ensemble function
In the combination_ensemble()
function, the inverse variances weights are calculated using innovation residuals (residuals on the transformed scale) obtained from individual models rather than response residuals. I think that's a mistake especially if it's a multiplicative error model for ETS.
This may be fixed by replacing the original code in the combination_ensemble()
function
inv_var <- map_dbl(x, function(x) 1/var(residuals(x)$.resid, na.rm = TRUE))
with
inv_var <- map_dbl(x, function(x) 1/var(residuals(x, type = "response")[[".resid"]], na.rm = TRUE))
.