R/safely_detect_changepoints.R
safely_detect_changepoints.Rd
The safely_detect_changepoints() function calculates the optimal positioning and number of changepoints for given data and penalty. It uses a PELT algorithm with a nonparametric cost function based on the empirical distribution. The implementation is inspired by the code available on https://github.com/rkillick/changepoint.
safely_detect_changepoints(data, penalty = "MBIC", nquantiles = 10)
a vector within which you wish to find changepoints
penalty for introducing another changepoint, one of "AIC", "BIC", "SIC", "MBIC", "Hannan-Quinn" or numeric non-negative value
the number of quantiles used in integral approximation
a vector of optimal changepoint positions (last observations of each segment)