IslandGA | R Documentation |
Perform the modified island-based genetic algorithm (IslandGA) for multiple changepoint detection. Minimization of an objective function using genetic algorithm (GA). The algorithm can be run sequentially or in explicit parallelisation.
IslandGA(
ObjFunc,
N,
IslandGA_param = .default.IslandGA_param,
IslandGA_operators = .default.operators,
p.range = NULL,
...
)
ObjFunc |
The fitness function to be minimized. Users can specify any R or Rcpp functions as the fitness function with setting input as potential solution to the optimization problem and returning a numerical value as the output/fitness. |
N |
The sample size of the time series. |
IslandGA_param |
A list contains the hyper-parameters for IslandGA.
The default values for these hyper-parameters are included in |
IslandGA_operators |
A list includes the functions for population initialization,
new individual selection, and genetic operator of crossover and mutation.
See |
p.range |
Default is |
... |
additional arguments that will be passed to the fitness function. |
Returns a list that has the following components.
overbestfit |
The obtained minimum value of the objective function after the final iteration. |
overbestchrom |
The locations of the detected changepoints associating
with the |
bestfit |
The minimized fitness function values at each iteration. |
bestchrom |
The detected changepoints at each iteration. |
countMig |
The number of migrations undertaken by the IslandGA. |
count |
The number of iterations (generations) undertaken by the island genetic algorithm model. |
convg |
An integer code.
|
N = 1000
XMatT = matrix(1, nrow=N, ncol=1)
Xt = ts.sim(beta=0.5, XMat=XMatT, sigma=1, phi=0.5, theta=NULL,
Delta=c(2, -2), CpLoc=c(250, 750), seed=1234)
TsPlotCheck(X=1:N, Xat=seq(from=1, to=N, length=10), Y=Xt, tau=c(250, 750))
IslandGA.res = IslandGA(ObjFunc=BinSearch.BIC, N=N, Xt=Xt)
IslandGA.res$overbestfit
IslandGA.res$overbestchrom
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.