You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The python docstrings for the beast() function mention the following example for monthly data:
## Monthly google search popularity of the keyword 'beach'
beach, time = rb.load_example('googletrend')
# If not specfified, season='harmonic' is assumed by default, with a seasonal
# component fitted.
o = rb.beast(beach, start=[2004,1], deltat=1/12) # deltat = 1/12 yr =1 month
rb.print(o)
rb.plot(o)
rb.plot(o,ncpStat='median')
# delta = 1/12: for dates, the default unit is year, so delta=1/12yr=1 month;
# period = 1.0 means 1 year
o=rb.beast(beach, start='2004-1-15', deltat=1/12, period=1.0)
# period='12 month': use a string to explicitly specify the unit
o=rb.beast(beach, start=[2004,1], deltat=1/12, period='12 month')
o=rb.beast(beach, start=[2004,1], deltat='1 month', period='365 days')
Here it is implied that the different (but equivalent) options given for the deltat and period arguments may influence how dates are handled, but not the actual analysis (?). However, when trying out the different options, they result in a different number of trend changepoints in the plot.
Specificallyo=rb.beast(beach, start='2004-1-15', deltat=1/12, period=1.0) results in 6 trend changepoints, while all other options result in 5 (I counted the black vertical lines in the plot).
I ran into the same issue with my own monthly data, i.e. getting varying numbers or date of occurence for trend changepoints when using deltat and period in ways that should be equivalent. I have also consulted the more detailed R documentation, but am still unsure what is causing this issue.
Is this a potential bug or am I misunderstanding how the function works? Can you recommend which options for deltat and period I should use when working with monthly averages (12 datapoints per year, over 22 years in total) which contain a seasonal component (in my case I am working with EVI data)?
Many thanks in advance!
The text was updated successfully, but these errors were encountered:
sarah-hlsn
changed the title
Different but equivalent inputs for deltat and periode yield contradicting results
Different but equivalent inputs for deltat and period yield contradicting results
Dec 17, 2024
The python docstrings for the
beast()
function mention the following example for monthly data:Here it is implied that the different (but equivalent) options given for the deltat and period arguments may influence how dates are handled, but not the actual analysis (?). However, when trying out the different options, they result in a different number of trend changepoints in the plot.
Specifically
o=rb.beast(beach, start='2004-1-15', deltat=1/12, period=1.0)
results in 6 trend changepoints, while all other options result in 5 (I counted the black vertical lines in the plot).I ran into the same issue with my own monthly data, i.e. getting varying numbers or date of occurence for trend changepoints when using
deltat
andperiod
in ways that should be equivalent. I have also consulted the more detailed R documentation, but am still unsure what is causing this issue.Is this a potential bug or am I misunderstanding how the function works? Can you recommend which options for
deltat
andperiod
I should use when working with monthly averages (12 datapoints per year, over 22 years in total) which contain a seasonal component (in my case I am working with EVI data)?Many thanks in advance!
The text was updated successfully, but these errors were encountered: