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

New vignette on extending tsibble's index support #207

Open
earowang opened this issue Jul 10, 2020 · 6 comments
Open

New vignette on extending tsibble's index support #207

earowang opened this issue Jul 10, 2020 · 6 comments

Comments

@earowang
Copy link
Member

  • index_valid()
  • index_pull()
  • new_interval() and gcd_interval()
  • seq() and + for new_data() and *_gaps()
@mabesa
Copy link

mabesa commented Jan 20, 2021

Hi Earo, many thanks for the tsibble package: it is great to work with and makes my data processing so much more elegant!

I frequently work with data in 10-days intervals (36 values per year) and will now try to implement index_valid() and index_pull() for my example. Do you already have minimal examples that you could share with me?

Trice monthly is a very common reporting interval for water-related data in (former) socialist countries. If(!) I get it running, would you be interested in a working example for 10-day tsibbles?

@Fuco1
Copy link

Fuco1 commented Jan 22, 2021

I work in the field of demand planning and we also use some 10-day (roughly) intervals for determining the demand in the first/middle/last part of the month. This somewhat tries to model the fact that people get their salaries in different parts of the month (around 4th, 15th and 25th is most common in my region) and this has often an effect on spending.

I would be very interested in a built-in 10 day interval, but specifically relative to its "parent" month. That is, Jan-Part1, Jan-Part2, Jan-Part3, Feb-Part1, etc..., never a 10 day interval overlapping two different months. Is this what you have in mind @mabesa ? If not, would something like this be implementable in the index framework @earowang ?

@mabesa
Copy link

mabesa commented Jan 22, 2021

Hi @Fuco1, yes, dekad 1 to 3 per month sounds good as well. I envision two date conversions month-dekad and year-dekad. But the vision is always the simple part, I only started reading the code and don't yet understand how I should use the index_valid etc. functions.

@earowang
Copy link
Member Author

@mabesa Have you implemented your own S3 class to represent data in 10-day intervals? If not, you perhaps need to implement the class and a few supporting methods first. You can check out R/yearweek.R for the yearweek() class to get some ideas. Defining index_pull() for your S3 class happens later.

@Fuco1 I don't have plans to implement scenario-varying index in {tsibble}.

@mabesa
Copy link

mabesa commented Jan 28, 2021

@earowang Thank you for the the hint! I understand now hot to go about it. Just need time now...

@mitchelloharawild
Copy link
Member

I've posted a SO answer which shows how a new index can be created using a minimal example of creating a year() index: https://stackoverflow.com/questions/65846176/r-tsibble-add-support-for-custom-index/66102152#66102152

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

No branches or pull requests

4 participants