Temporal Hierarchical Aggregation on a local or global level.
month-1
doesn’t correspond to the same (year, month) for
both timeseries. This is because the series with unique_id=1
is
shorter and has its first datapoint in July 2000, in contrast to the
series with unique_id=0
, which is longer and has its first timestamp
in March 2000.
temporal_id | unique_id | ds | y | |
---|---|---|---|---|
39 | month-1 | 0 | 2000-03-16 | 93.574676 |
87 | month-1 | 1 | 2000-07-19 | 91.506421 |
aggregation_type
attritbue in
aggregate_temporal
.
month-1
corresponds to the same (year,
month)-combination for both timeseries. Since month-1
isn’t present in
the second timeseries (as it is shorter), we have only one record for
the aggregation.
temporal_id | unique_id | ds | y | |
---|---|---|---|---|
39 | month-1 | 0 | 2000-03-16 | 93.574676 |
month-5
however, we have a record for both timeseries, as the
second series has its first datapoint in that month.
temporal_id | unique_id | ds | y | |
---|---|---|---|---|
43 | month-5 | 0 | 2000-07-14 | 95.169659 |
87 | month-5 | 1 | 2000-07-14 | 74.502584 |
global
and local
yield the same results.local
. This means that temporal
aggregations between timeseries can’t be compared unless the series
have the same length and timestamp. This behavior is generally
safer, and advised to use when time series are not necessarily
related, and you are building per-series models using
e.g. StatsForecast
.global
behavior can be useful when dealing with timeseries
where we expect relationships between the timeseries. For example,
in case of forecasting daily product demand individual products may
not always have sales for all timesteps, but one is interested in
the overall temporal yearly aggregation across all products. The
global
setting has more room for error, so be careful and check
the aggregation result carefully. This would typically be the
setting used in combination with models from MLForecast
or
NeuralForecast
.