Manually segment a time series
segment_manual.Rd
Segment a time series by manually inputting the changepoint set
Arguments
- x
A time series
- tau
a set of indices representing a changepoint set
- ...
arguments passed to seg_cpt
Value
A seg_cpt object
Details
Sometimes you want to see how a manually input set of changepoints performs.
This function takes a time series and a changepoint detection set as inputs
and returns a seg_cpt object representing the segmenter.
Note that by default fit_meanshift_norm()
is used to fit the model and
BIC()
is used as the penalized objective function.
Examples
# Segment a time series manually
segment_manual(CET, tau = c(84, 330))
#> List of 8
#> $ data : Time-Series [1:362] from 1 to 362: 8.87 9.1 9.78 9.52 8.63 9.34 8.29 9.86 8.52 9.51 ...
#> $ pkg : chr "tidychangepoint"
#> $ algorithm : chr "manual"
#> $ changepoints: num [1:2] 84 330
#> $ fitness : Named num 688
#> ..- attr(*, "names")= chr "BIC"
#> $ seg_params : list()
#> $ model_name : chr "meanshift_norm"
#> $ penalty : chr "BIC"
#> - attr(*, "class")= chr "seg_cpt"
segment_manual(CET, tau = NULL)
#> List of 8
#> $ data : Time-Series [1:362] from 1 to 362: 8.87 9.1 9.78 9.52 8.63 9.34 8.29 9.86 8.52 9.51 ...
#> $ pkg : chr "tidychangepoint"
#> $ algorithm : chr "manual"
#> $ changepoints: NULL
#> $ fitness : Named num 759
#> ..- attr(*, "names")= chr "BIC"
#> $ seg_params : list()
#> $ model_name : chr "meanshift_norm"
#> $ penalty : chr "BIC"
#> - attr(*, "class")= chr "seg_cpt"