random_population: Random population initialization

View source: R/RcppExports.R

random_populationR Documentation

Random population initialization

Description

Randomly generate the individuals' chromosomes (changepoint confirgurations) to construct the first generation population.

Usage

random_population(popsize, prange, N, minDist, Pb, mmax, lmax)

Arguments

popsize

An integer represents the number of individual in each population for GA (or subpopulation for IslandGA).

prange

Default is NULL for only changepoint detection. If prange is specified as a list object, which contains the range of each model order parameters for order selection (integers). The number of order parameters must be equal to the length of prange.

N

The length of time series.

minDist

The minimum length between two adjacent changepoints.

Pb

Same as Pchangepoint, the probability that a changepoint has occurred.

mmax

The maximum possible number of changepoints in the data set.

lmax

The maximum possible length of the chromosome representation.

Details

The default population initialization uses selectTau to select the chromosome for the first generation population. Each column from the produced population matrix represent an chromosome of an individual. The first element of every chromosome represent the number of changepoints and the last non-zero element always equal to the length of time series plus one (N+1).

Value

A matrix that contains each individual's chromosome.


changepointGA documentation built on April 4, 2025, 4:39 a.m.