There's an issue with forecast_categorical(). It looks to see if a level is completely missing from the forecasts. E.g., large_increase would be unlikely to be seen for any location in recent data, so it would bind in large_increasewith value 0 for all locations. However, if at least one location has >0 probability for large_increase, it will not be perceived as missing_from_res in our current implementation, and would not be filled in for locations where large_increase was absent. A better approach is to cross everything, removing locations where you actually have observed >0 density, then bind that back into the original incomplete data.
Demonstration below. We have three locations, and we should expect 15 rows returned. In our current implementation we only get 12 rows returned.
There's an issue with
forecast_categorical()
. It looks to see if a level is completely missing from the forecasts. E.g.,large_increase
would be unlikely to be seen for any location in recent data, so it would bind inlarge_increase
with value 0 for all locations. However, if at least one location has >0 probability forlarge_increase
, it will not be perceived asmissing_from_res
in our current implementation, and would not be filled in for locations wherelarge_increase
was absent. A better approach is to cross everything, removing locations where you actually have observed >0 density, then bind that back into the original incomplete data.Demonstration below. We have three locations, and we should expect 15 rows returned. In our current implementation we only get 12 rows returned.
Created on 2023-03-14 with reprex v2.0.2