Nixtla/hierarchicalforecast

Add temporal hierarchies

Opened this issue · 2 comments

Description

Hi,
I saw someone in the slack asking if there is a way to handle temporal hierarchies.
So I'm opening this feature request, if it can be done.

Thanks very much

Use case

For example, I have daily data, I would like to aggregate it weekly and monthly.
Forecast each temporal level and reconciliate.

Hey @NasreddineD. I believe you can do this by adding the columns and defining the spec, e.g.

df['month'] = df['ds'].dt.month.astype(str)
df['week'] = df['ds'].dt.isocalendar()['week'].astype(str)
spec = [['month', 'week']]
aggregate(df, spec)