Learn R Programming

tidychangepoint (version 1.0.1)

segment_cga: Segment a time series using a genetic algorithm

Description

Segmenting functions for various genetic algorithms

Usage

segment_cga(x, ...)

Value

A cga object. This is just a changepointGA::GA()

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

Arguments

x

A time series

...

arguments passed to changepointGA::GA()

Details

segment_cga() uses the genetic algorithm in GA::ga() 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_cga(CET)
summary(res)

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

Run the code above in your browser using DataLab