Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change integers for season_peak and season_trough #126

Open
robjhyndman opened this issue Mar 16, 2021 · 3 comments
Open

Change integers for season_peak and season_trough #126

robjhyndman opened this issue Mar 16, 2021 · 3 comments

Comments

@robjhyndman
Copy link
Member

These current take values 0:(m-1). It would be much easier to interpret if they took 1:m by changing 0 to m and leaving the others as they are. See https://otexts.com/fpp3/exploring-australian-tourism-data.html where we have had to modify it to get an interpretable graph.

@mitchelloharawild
Copy link
Member

mitchelloharawild commented Mar 16, 2021

Ideally this would give you a year-less unit, much like r-lib/clock#61 as this would allow us to embed the "quarter" component to this. I don't know of an established data structure for this type of data yet, but I'm hoping {clock} will be suitable ({moment} was partially created for this type of problem also).

I think the right approach for this is to provide more information to the feature methods (specifically the data's index). Currently the value is relative to the starting time within the seasonal period. I don't want to offset it to 1:m because this could mislead users into thinking that 1 is always "Q1".

edit: However if/when features() is updated to provide additional info like the index, making this analysis easier would be possible.

@robjhyndman
Copy link
Member Author

Actually I think 1 should always be Q1 for quarterly data. So with monthly data, if the first month in the data set is February, and the seasonal peak is March, then it should take season_peak_year=3.

@mitchelloharawild
Copy link
Member

Yes, this is what I would like also.
To make this possible, we need features(<tsibble>) to provide the index variable to feature functions where necessary.

In combination with potential improvements in time/date classes ({clock} 🤞), this would allow us to provide season_peak_year=Q1 or season_peak_year=March to eliminate all confusion. Here Q1 and March are continuous, year-less, time variables which can be promoted to year-quarter or year-month variables by setting the year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants