pydlm
pydlm copied to clipboard
How to set biweekly frequency in seasonal parameter?
Hi.
I want to fit a time serie with biweekly frequency.
I'm wondering if there's a way to set the biweekly frequency in seasonal parameter.
I know that for daily data, frequency = 7, monthly = 12, quarterly = 4...but I can't figure out how to set biweekly data...maybe 52 / 2 = 26 ???
Thanks a lot.
Hi Alex,
This depends on the granularity of your data. Following is based on the assumption that the time series is daily.
Then bi-weekly frequency should be 14 if you assume weekdays are different (i.e, Monday is different from Tuesday). seasonality(period=14). An example for this would be
Week 1: 1, 2, 3, 4, 5, 6, 7 Week 2: 8, 7, 6, 5, 4, 3, 2 Week 3: 1, 2, 3, 4, 5, 6, 7 ...
If you assume there is no difference among weekdays (i.e., Monday is the same as Tuesday), then you should consider using longSeason longSeason(period=2, stay=7, ...). An example for this would be
Week 1: 1, 1, 1, 1, 1, 1, 1 Week 2: 2, 2, 2, 2, 2, 2, 2 Week 3: 1, 1, 1, 1, 1, 1, 1 ...
For monthly frequency, it depends on what you mean by "monthly". If you mean the first day of each month should be the same, then you should use seaonality(period=30) or seaonality(period=31) depending on your belief of the month length... If you mean January this year should be the same as the January of next year, then you should use longSeason(period=12, stay=30) or longSeason(period=12, stay=31)
Likewise for quarterly, depending on the actual meaning you want, you might choose either seasonality(period=90) or longSeason(period=4, stay=90).
Thanks
Thanks a lot for your response, it’s very helpful.
I’ll try it right now :)
Regards!!
From: Sam [mailto:[email protected]] Sent: lunes, 27 de noviembre de 2017 11:47 p. m. To: wwrechard/pydlm Cc: alexkreamas; Author Subject: Re: [wwrechard/pydlm] How to set biweekly frequency in seasonal parameter? (#18)
Hi Alex,
This depends on the granularity of your data. Following is based on the assumption that the time series is daily.
Then bi-weekly frequency should be 14 if you assume weekdays are different (i.e, Monday is different from Tuesday). seasonality(period=14). An example for this would be
Week 1: 1, 2, 3, 4, 5, 6, 7 Week 2: 8, 7, 6, 5, 4, 3, 2 Week 3: 1, 2, 3, 4, 5, 6, 7 ...
If you assume there is no difference among weekdays (i.e., Monday is the same as Tuesday), then you should consider using longSeason longSeason(period=2, stay=7, ...). An example for this would be
Week 1: 1, 1, 1, 1, 1, 1, 1 Week 2: 2, 2, 2, 2, 2, 2, 2 Week 3: 1, 1, 1, 1, 1, 1, 1 ...
For monthly frequency, it depends on what you mean by "monthly". If you mean the first day of each month should be the same, then you should use seaonality(period=30) or seaonality(period=31) depending on your belief of the month length... If you mean January this year should be the same as the January of next year, then you should use longSeason(period=12, stay=30) or longSeason(period=12, stay=31)
Likewise for quarterly, depending on the actual meaning you want, you might choose either seasonality(period=90) or longSeason(period=4, stay=90).
Thanks
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wwrechard/pydlm/issues/18#issuecomment-347420473 , or mute the thread https://github.com/notifications/unsubscribe-auth/AYADm0Ea8NPgxIl7-H-g7wRhevf5SQYDks5s6546gaJpZM4PO10j .