gluonts icon indicating copy to clipboard operation
gluonts copied to clipboard

Canonical `freq` strings

Open jaheba opened this issue 6 years ago • 6 comments

We use pandas to handle time-frequencies. However, some frequency names are just aliases, which are resolved to a canonical form, see:

  • https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases

  • https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#anchored-offsets

For example Y (yearly) becomes A-DEC, since Y is just an alias for A (annual, end of year), and it is further resolved to specify the month. Similarly, AS (annual, start of year) is resolved as AS-JAN.

I would recommend that we only handle the canonical form in GluonTS and make sure that we convert it as soon as possible in all places.


To get the canonical form, we can use pandas.tseries.frequencies.to_offset.

And maybe we should avoid using freqstr at all.

jaheba avatar Aug 27 '19 18:08 jaheba

In time_feature, we currently support these frequencies:

  • yearly

  • monthly

  • weekly

  • daily

  • hourly

  • minutely

I would propose to also add:

  • secondly
  • quarterly

The question is how we should support other frequencies and multiples of frequencies. For example, while 12M (12 months) is a valid frequency, A (annual) frequency should be used instead. In this case adding the month as a time-feature doesn't make much sense, while for 1M it does.

jaheba avatar Sep 02 '19 15:09 jaheba

Is there a reason why quarterly and secondly are harder to implement than the others?

SkanderHn avatar Feb 21 '20 05:02 SkanderHn

Hi @jaheba I also ran into freq issues when using time-series based on US business days. As you know, we have to construct DeepAREstimator (and other estimators) with freq string but what I really need is custom business day offsets. Otherwise, all the lags are shifted when using make_evaluation_predictions. Why not simply use offsets provided by pandas?

vblagoje avatar May 08 '20 08:05 vblagoje

Hi,

I need to work on second and microsecond data. Is it possible in version 0.5 using the freq argument? Or is there a workaround?

Thanks,

Alex

alexcombessie avatar May 21 '20 08:05 alexcombessie

Hi @jaheba,

I am trying to understand whether gluon-ts can address second and microsecond forecasting use cases. This is linked to my other question on #367.

Could you please confirm if this is possible or not?

Thanks,

Alex

alexcombessie avatar May 26 '20 09:05 alexcombessie

@alexcombessie, I'm wondering about this myself.

rothn avatar Oct 16 '20 01:10 rothn