Nixtla/hierarchicalforecast

MinTraceSparse(nonnegative=True)

Opened this issue · 1 comments

Description

As of release 0.4.0, the MinTraceSparse() reconciliation function is executable, but only as MinTraceSparse(nonnegative=False). In order to produce a sparse reconciliation with nonnegative forecasts, it would be helpful to extend this function to accept MinTraceSparse(nonnegative=True).

Use case

In some use case domains, forecasts should be constrained to strictly nonnegative values. For example, if one is forecasting sales units over a time horizon, a reconciled forecast generating negative units wouldn't make practical sense. While it is possible to cap these negative forecasts to 0 units post-reconciliation, the workaround is inelegant & may not produce results consistent with a true nonnegative implementation of MinTraceSparse().

Yeeah, I agree. But TBH I haven't had time to do it, or check if it's at all doable with the method of Hyndman et al. in the sparse approach. What is certainly doable (and was actually advocated by Hyndman as a reasonable poor-man's solution to this problem), is to take MinTSparse, cap all the negative bottom time series to zero, and do BottomUpSparse again.