cptga-class: S4 Class Definition for 'cptga'

cptga-classR Documentation

S4 Class Definition for 'cptga'

Description

S4 Class for Genetic Algorithm-Based Changepoint Detection

Usage

## S4 method for signature 'cptga'
summary(object, ...)

Arguments

object

An object of class cptga.

...

Additional arguments (ignored).

Details

An object of class cptga stores results and configuration settings for changepoint detection using a Genetic Algorithm (GA), optionally with simultaneous model order selection. This class records GA control parameters, intermediate population structures, and the optimal solution found.

Value

An object of class cptga.

Slots

call

The matched call that created the object.

N

The sample size of the time series.

prange

A list object. Default is NULL. If specified, it contains the ranges for each model order parameter (integers). Required when option = "both" is used for joint changepoint and model selection.

popSize

An integer representing the number of individuals in each GA population.

pcrossover

The probability that the crossover operator is applied to two chromosomes.

pmutation

The probability that the mutation operator is applied to a chromosome.

pchangepoint

The prior probability that a changepoint has occurred at each location.

minDist

The minimum allowed distance between two adjacent changepoints.

mmax

The maximum possible number of changepoints. Typically set based on time series length and option.

lmax

The maximum length of the chromosome. Typically set based on time series length and option.

maxgen

The maximum number of generations the GA is allowed to run.

maxconv

If the optimal fitness value does not improve over this many generations, GA stops.

option

A character string: either "cp" for changepoint detection only, or "both" for changepoint detection and model order selection.

monitoring

Logical. If TRUE, prints intermediate GA progress.

parallel

Logical. If TRUE, enables parallel computation for fitness evaluation.

nCore

Integer or NULL. Number of cores used for parallel computation when parallel = TRUE.

tol

Numeric. Tolerance for determining GA convergence. Default is 1e-5.

seed

An integer or NULL. Random seed for reproducibility.

suggestions

A list or NULL. Each element provides suggested changepoint locations to guide initial population design and potentially accelerate convergence.

population

A matrix where each row represents an individual chromosome in the current population.

fitness

A numeric vector containing the fitness values of individuals in the current generation.

overbestchrom

A vector representing the best chromosome found over all generations.

overbestfit

A numeric scalar. The best (smallest) fitness value achieved.

bestfit

A numeric vector recording the best fitness value in each generation.

count

A numeric value indicating the number of generations the GA actually ran.

convg

A numeric vector representing convergence information. A value of 0 indicates the algorithm successful completion. A value of 1 indicates the the total number of generations exceeds the pre-specified maxgen limit.

See Also

cptga, cptga-class, random_population, selection_linearrank, uniformcrossover, mutation.


changepointGA documentation built on Nov. 5, 2025, 6:54 p.m.