Learn R Programming

tidychangepoint (version 1.0.2)

segment_cptga: Segment a time series using a genetic algorithm

Description

Segmenting functions for various genetic algorithms

Usage

segment_cptga(x, ...)

Value

A tidycptga object. This is just a changepointGA::cptga()

object with an additional slot for data (the original time series).

Arguments

x

A time series

...

arguments passed to changepointGA::cptga()

Details

segment_cptga() uses the genetic algorithm in changepointGA::cptga() to "evolve" a random set of candidate changepoint sets, using the penalized objective function specified by penalty_fn. By default, the normal meanshift model is fit (see fit_meanshift_norm()) and the BIC penalty is applied.

Examples

Run this code
# \donttest{
# Segment a time series using a genetic algorithm
res <- segment_cptga(CET)
summary(res)

# Segment a time series using changepointGA
x <- segment(CET, method = "cptga")
summary(x)
changepoints(x)
# }

Run the code above in your browser using DataLab