rkillick / EnvCpt

A place for the development version of the changepoint package on CRAN. The master thread is that from CRAN.
5 stars 14 forks source link

Document selection criteria #12

Closed multimeric closed 2 years ago

multimeric commented 2 years ago

Hi, apologies if this is documented somewhere, but I'm trying to work out the selection criteria/penalty that is used by cpt.reg by default to fit the changepoint regression model. Certainly there is the option to use MBIC but this doesn't seem to be the default, and when I look into the source code I can't work out what it's using. Many thanks.

rkillick commented 2 years ago

Apologies for the delay in reply, I've been off with covid.

The default selection criteria used by cpt.reg is MBIC. The envcpt() documentation states that the default for all changepoint methods is MBIC. This isn't obvious from the call within the envcpt() function as it is the default. If you want to check you can look at EnvCpt:::cpt.reg in the terminal and you can see that the function call starts with

function (data, penalty = "MBIC", pen.value = 0, method = "AMOC", dist = "Normal", class = TRUE, param.estimates = TRUE, minseglen = 3, shape = 0, tol = 1e-07)

where the default MBIC penalty becomes clear.

My plan is for the cpt.reg() function to return to the changepoint package now it is coded in C. This is why it isn't fully documented within the EnvCpt package to make that transition simpler in the future. With everything that has been going on I haven't had chance to do this yet so I understand that it must be frustrating for a user that wants to use cpt.reg() directly rather than within envcpt().

If you have any further questions about cpt.reg() then please do post them.

multimeric commented 2 years ago

Many thanks for the reply. I'm sorry for asking at an inconvenient time.

I'm having trouble finding the explanation about MBIC when I ?EnvCpt::envcpt, but I think this would make for helpful documentation. I agree that having cpt.reg in changepoint would be great, especially as an exported function with documentation. My motivation here is basically that I have found that cpt.reg works very well but would like to be able to document exactly why it does so.