This function wraps a number of cpt functions from the changepoint
package and the cpt.np() function from the changepoint.np package.
It is handy that users can use this function to get the same changepoint
results as these functions output individually. Moreover, it returns a tibble
that inherits the tidyverse sytle. Functions from the changepoint package do
require data normality assumption by default, yet changepoint.np is a
non-parametric way to detect changepoints and let data speak by itself.
If user sets change_in as cpt_np, a seed should be set before
using the function for the sake of reproducibility. For more details on the
changepoint and changepoint.np packages, please refer to their documentation.
Arguments
- data
A vector.
- change_in
Choice of
mean_var,mean,var, andcpt_np. Each choice corresponds tocpt.meanvar(),cpt.mean(),cpt.var()andcpt.np()respectively. The default ismean_var.- cp_method
A wide range of choices (i.e.,
AMOC,PELT,SegNeighorBinSeg). Please note whenchange_iniscpt_np,PELTis the only option.- ...
Extra arguments for each
cptfunction mentioned in thechange_insection.
Value
A tibble includes which point(s) is/are the changepoint along with raw changepoint value corresponding to that changepoint.