fabletools
fabletools copied to clipboard
add reconciliation with immutable forecasts
see https://github.com/tidyverts/fabletools/issues/352. I implemented the immutability method only for sparse=TRUE for now.
examples:
tourism_full <- tsibble::tourism %>%
aggregate_key((State/Region) * Purpose, Trips = sum(Trips))
fit <- tourism_full %>%
filter(year(Quarter) <= 2015) %>%
model(base = fable::ARIMA(Trips))
fit <- reconcile(
fit,
ols_td = min_trace(base, method = "ols",
immu = is_aggregated(State) & is_aggregated(Purpose)),
ols_purpose_mo = min_trace(base, method = "ols",
immu = is_aggregated(State) & !is_aggregated(Purpose)),
ols_state_mo = min_trace(base, method = "ols",
immu = !is_aggregated(State) & is_aggregated(Purpose) & is_aggregated(Region))
)
Looks great and simple, thanks! I'll use this code and rework it into a more general nicer interface for reconciliation. Could you add yourself as ctb for this package, and provide a NEWS entry that summarises this change?