zhaokg / Rbeast

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

Issue on marginal likelihood #27

Closed JJ closed 1 month ago

JJ commented 1 month ago

The manual says:

the average of the model marginal likelihood; the larger marg_lik, the
better the fitting for a given time series.

Would that be the negative larger? Foir instance, -1000 would be better than -10, right?

dirt commented 1 month ago

Juan,

Thanks for asking . It is the other way around: It is the log-likelihood (not negative log-likilhood), so -10 is better than -1000. Here is an example in R.

library(Rbeast)
m0=beast(Nile, tcp.minmax = c(0,0))
m1=beast(Nile, tcp.minmax = c(1,1))
m2=beast(Nile, tcp.minmax = c(2,2))
m3=beast(Nile, tcp.minmax = c(3,3))

This is what I got:

c( m0$marg_lik, m1$marg_lik, m2$marg_lik, m3$marg_lik) [1] -189.1034 -173.2117 -174.0677 -174.3938

And the second model has the largest marginal likelihood.

Kaiguang


From: Juan Julián Merelo Guervós @.> Sent: Wednesday, May 15, 2024 8:04 AM To: zhaokg/Rbeast @.> Cc: Subscribed @.***> Subject: [zhaokg/Rbeast] Issue on marginal likelihood (Issue #27)

The manual says: the average of the model marginal likelihood; the larger marg_lik, the better the fitting for a given time series. Would that be the negative larger? Foir instance, -1000 would be better than -10, right? —Reply to this

The manual says:

the average of the model marginal likelihood; the larger marg_lik, the better the fitting for a given time series.

Would that be the negative larger? Foir instance, -1000 would be better than -10, right?

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/zhaokg/Rbeast/issues/27__;!!KGKeukY!wg9pkUeX_mPwTZZujy6UkOZ2pBg2O1gYQQaK_GJ8teWyq-S2I8P_xd2NUh9iL4MbfLUS0j2KenfOjqZ_vIMQvqhIgaNf$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AMCAGWWGQIV7GFIFJVYC6CDZCNFM3AVCNFSM6AAAAABHYARY6WVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4TONZSGE4TMNY__;!!KGKeukY!wg9pkUeX_mPwTZZujy6UkOZ2pBg2O1gYQQaK_GJ8teWyq-S2I8P_xd2NUh9iL4MbfLUS0j2KenfOjqZ_vIMQvuB0heT6$. You are receiving this because you are subscribed to this thread.Message ID: @.***>

JJ commented 1 month ago

Maybe "highest" is the word you're looking for? Or just an example. I can propose a pull request, if you want. Thanks a lot for the quick answer.

zhaokg commented 1 month ago

JJ, Thanks a lot. If you can propose a pull request and I will incorporate that. Appreciate your input and contribution.

JJ commented 1 month ago

I'm afraid I can't find the specific string in this repository. It's probably in the tar file, I can probably make a change and re-package, but is there maybe another repo with the source for that tar ball?

dirt commented 1 month ago

Juan,

Thanks for the note. Now I upload the whole R package source files under https://github.com/zhaokg/Rbeast/tree/master/R. Pleases make any changes as needed. I appreciate your input as a contributor.

Best, Kai


From: Juan Julián Merelo Guervós @.> Sent: Wednesday, May 15, 2024 2:27 PM To: zhaokg/Rbeast @.> Cc: Zhao, Kaiguang @.>; Comment @.> Subject: Re: [zhaokg/Rbeast] Issue on marginal likelihood (Issue #27)

I'm afraid I can't find the specific string in this repository. It's probably in the tar file, I can probably make a change and re-package, but is there maybe another repo with the source for that tar ball? — Reply to this email directly,

I'm afraid I can't find the specific string in this repository. It's probably in the tar file, I can probably make a change and re-package, but is there maybe another repo with the source for that tar ball?

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https://github.com/zhaokg/Rbeast/issues/27*issuecomment-2113177607__;Iw!!KGKeukY!zMPN3qaiHpCjZqNkwoS-Lmco49YUA4kPqGVLnKcHxs0hqEQ0bPvGFFuv2wp2f0ZpuE9AoE5LD0mvzOeeMS4AH79Zhcba$, or unsubscribehttps://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AMCAGWXBWEWJEEVVPX3IYCLZCOSJRAVCNFSM6AAAAABHYARY6WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJTGE3TONRQG4__;!!KGKeukY!zMPN3qaiHpCjZqNkwoS-Lmco49YUA4kPqGVLnKcHxs0hqEQ0bPvGFFuv2wp2f0ZpuE9AoE5LD0mvzOeeMS4AH2mbI4Uu$. You are receiving this because you commented.Message ID: @.***>