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 style. 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 np (or 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 numeric vector.
- change_in
Choice of
mean_var,mean,var, andnp(orcpt_npfor backward compatibility). 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_inisnporcpt_np,PELTis the only option.- ...
Extra arguments for each
cptfunction mentioned in thechange_insection.
Value
A tibble including which point(s) is/are the changepoint along with
raw changepoint value corresponding to that changepoint. Changepoint
locations follow the convention of the changepoint package: the
last index of the left segment.
