cpt_wrapper | R Documentation |
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.
cpt_wrapper(data, change_in = "mean_var", cp_method = "PELT", ...)
data |
A vector. |
change_in |
Choice of |
cp_method |
A wide range of choices (i.e., |
... |
Extra arguments for each |
A tibble includes which point(s) is/are the changepoint along with raw changepoint value corresponding to that changepoint.
killick2014changepointggchangepoint
set.seed(2022) cpt_wrapper(c(rnorm(100,0,1),rnorm(100,0,10))) cpt_wrapper(c(rnorm(100,0,1),rnorm(100,10,1)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.