zhaokg / Rbeast

Bayesian Change-Point Detection and Time Series Decomposition
208 stars 36 forks source link

Error setting MaxKnotNum_Trend to zero #1

Closed jacobmardian closed 2 years ago

jacobmardian commented 4 years ago

I would like to set MaxKnotNum_Trend to zero to examine seasonal changes only. When I do this I get the error "r2<r1:There must be something wrong!" before RStudio crashes.

mcneilsm commented 3 years ago

Hi jacobmardian, were you able to figure out how to set MaxKnotNum_Trend to zero? I am in a similar position where I would like to set MaxKnotNum_Season to zero to examine trend changes only, but I get the same error as you did.

zhaokg commented 2 years ago

Hi jacobmardian and mcneilsm; Sorry for not get a chance to see your issue report earlier and for my belated reply. Not sure if my reply is still relevant to you (probably not. Jacob, thanks for testing out BEAST in your rse paper), although I saw your paper earlier than seeing your issue here.

Also, thanks a lot for all the feedbacks. The original version of Rbeast posted 3 years was too buggy, failing to handle many edge cases and often leading to misinterpretation of results by non-Bayesian users. Regardless, in the new version, I corrected for the cases. Here are some examples/addiations:

** It is possible to fit a trend-only model if the data has no periodic component at all

library(Rbeast)
o=beast(Nile, season='none')
plot(o)

** It is possible to set the seasonMaxKnotNum=0 or trendMaxKnotNum=0

library(Rbeast)
o=beast(Nile, season='none', tcp.minmax=c(0,0) )  #set the min and max number of trend changepoints to zero, which basically fit a global trend model. Similarly you can also set scp.minmax=c(0,0) if the time series has a seasonal component
plot(o)

Once again, thanks a lot for your valuable feedbacks. Sorry for overlooking your report here.

mcneilsm commented 2 years ago

Thanks for the update, Kai! Shelby

From: zhaokg @.> Sent: Monday, March 28, 2022 12:28 AM To: zhaokg/Rbeast @.> Cc: McNeill, Shelby M @.>; Comment @.> Subject: Re: [zhaokg/Rbeast] Error setting MaxKnotNum_Trend to zero (#1)

Hi jacobmardian and mcneilsm; Sorry for not get a chance to see your issue report earlier and for my belated reply. Not sure if my reply is still relevant to you (probably not. Jacob, thanks for testing out BEAST in your rse paper), although I saw your paper earlier than seeing your issue here.

Also, thanks a lot for all the feedbacks. The original version of Rbeast posted 3 years was too buggy, failing to handle many edge cases and often leading to misinterpretation of results by non-Bayesian users. Regardless, in the new version, I corrected for the cases. Here are some examples/addiations:

** It is possible to fit a trend-only model if the data has no periodic component at all

library(Rbeast)

o=beast(Nile, season='none')

plot(o)

** It is possible to set the seasonMaxKnotNum=0 or trendMaxKnotNum=0

library(Rbeast)

o=beast(Nile, season='none', tcp.minmax=c(0,0) ) #set the min and max number of trend changepoints to zero, which basically fit a global trend model. Similarly you can also set scp.minmax=c(0,0) if the time series has a seasonal component

plot(o)

Once again, thanks a lot for your valuable feedbacks. Sorry for overlooking your report here.

- Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fzhaokg%2FRbeast%2Fissues%2F1%23issuecomment-1080211355&data=04%7C01%7Cshelby.m.mcneill%40vanderbilt.edu%7Cb24b16290e69453a3dcd08da107bcb3a%7Cba5a7f39e3be4ab3b45067fa80faecad%7C0%7C0%7C637840421123591760%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=pvMIDqAM6cT9tT92fBla40PN3VxVtHYszjecM9w67sY%3D&reserved=0, or unsubscribehttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHRCJUPO25N5PQ4O2RYLL53VCE7P3ANCNFSM4NJT5BOA&data=04%7C01%7Cshelby.m.mcneill%40vanderbilt.edu%7Cb24b16290e69453a3dcd08da107bcb3a%7Cba5a7f39e3be4ab3b45067fa80faecad%7C0%7C0%7C637840421123591760%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=68q8fBgGOAvsZYNxAVOzJ%2FCvlupIS%2Fen8Yh1Yvidyes%3D&reserved=0. You are receiving this because you commented.Message ID: @.**@.>>