Title: | Automatic Calibration by Evolutionary Multi Objective Algorithm |
---|---|
Description: | The caRamel optimizer has been developed to meet the requirement for an automatic calibration procedure that delivers a family of parameter sets that are optimal with regard to a multi-objective target (Monteil et al. <doi:10.5194/hess-24-3189-2020>). |
Authors: | Nicolas Le Moine [aut], Celine Monteil [aut], Frederic Hendrickx [ctb], Fabrice Zaoui [aut, cre], Alban de Lavenne [ctb] |
Maintainer: | Fabrice Zaoui <[email protected]> |
License: | GPL-3 | file LICENSE |
Version: | 1.4 |
Built: | 2024-11-11 07:27:06 UTC |
Source: | CRAN |
Automatic Calibration by Evolutionary Multi Objective Algorithm
caRamel is a package for multi-objective optimization of complex environmental models.
The algorithm is a hybrid of the MEAS algorithm (Efstratiadis and Koutsoyiannis, 2005) by using the directional search method based on the simplexes of the objective space and the epsilon-NGSA-II algorithm with the method of classification of the parameter vectors archiving management by epsilon-dominance (Reed and Devireddy, 2004).
The main function of the package is caRamel().
This function uses all the other functions of the package.
An example of an hydrological optimization is available on the following presentation: useR! 2019
Fabrice Zaoui, Nicolas Le Moine, Celine Monteil (EDF R&D - LNHE)
Efstratiadis, A. and Koutsoyiannis, D. (2005) The multi-objective evolutionary annealing-simplex method and its application in calibration hydrological models, in EGU General Assembly 2005, Geophysical Research Abstracts, Vol. 7, Vienna, 04593, European Geophysical Union. doi:10.13140/ RG.2.2.32963.81446.
Le Moine, N. (2009) Description d’un algorithme génétique multi-objectif pour la calibration d’un modèle pluie-débit (in French). Post-Doctoral Status Rep. 2, UPMC/EDF, 13 pp.
Reed, P. and Devireddy, D. (2004) Groundwater monitoring design: a case study combining epsilon-dominance archiving and automatic parameterization for the NSGA-II, in Coello-Coello C, editor. Applications of multi-objective evolutionary algorithms, Advances in natural computation series, vol. 1, pp. 79-100, World Scientific, New York. doi:10.1142/9789812567796_0004.
This function returns a box number for each points individual of the population
boxes(points, prec)
boxes(points, prec)
points |
: matrix of the objectives |
prec |
: (double, length = nobj) desired accuracy for the objectives (edges of the boxes) |
vector of numbers for the boxes. boxes[i] gives the number of the box containing points[i].
Fabrice Zaoui
# Definition of the parameters points <- matrix(rexp(200), 100, 2) prec <- c(1.e-3, 1.e-3) # Call the function res <- boxes(points, prec)
# Definition of the parameters points <- matrix(rexp(200), 100, 2) prec <- c(1.e-3, 1.e-3) # Call the function res <- boxes(points, prec)
Multi-objective optimizer. It requires to define a multi-objective function (func) to calibrate the model and bounds on the parameters to optimize.
caRamel( nobj, nvar, minmax, bounds, func, popsize, archsize, maxrun, prec, repart_gene = c(5, 5, 5, 5), gpp = NULL, blocks = NULL, pop = NULL, funcinit = NULL, objnames = NULL, listsave = NULL, write_gen = FALSE, carallel = 1, numcores = NULL, graph = TRUE, sensitivity = FALSE, verbose = TRUE, worklist = NULL )
caRamel( nobj, nvar, minmax, bounds, func, popsize, archsize, maxrun, prec, repart_gene = c(5, 5, 5, 5), gpp = NULL, blocks = NULL, pop = NULL, funcinit = NULL, objnames = NULL, listsave = NULL, write_gen = FALSE, carallel = 1, numcores = NULL, graph = TRUE, sensitivity = FALSE, verbose = TRUE, worklist = NULL )
nobj |
: (integer, length = 1) the number of objectives to optimize (nobj >= 2) |
nvar |
: (integer, length = 1) the number of variables |
minmax |
: (logical, length = nobj) the objective is either a minimization (FALSE value) or a maximization (TRUE value) |
bounds |
: (matrix, nrow = nvar, ncol = 2) lower and upper bounds for the variables |
func |
: (function) the objective function to optimize. Input argument is the number of parameter set (integer) in the x matrix. The function has to return a vector of at least 'nobj' values (Objectives 1 to nobj are used for optimization, values after nobj are recorded for information.). |
popsize |
: (integer, length = 1) the population size for the genetic algorithm |
archsize |
: (integer, length = 1) the size of the Pareto front |
maxrun |
: (integer, length = 1) the max. number of simulations allowed |
prec |
: (double, length = nobj) the desired accuracy for the optimization of the objectives |
repart_gene |
: (integer, length = 4) optional, number of new parameter sets for each rule and per generation |
gpp |
: (integer, length = 1) optional, calling frequency for the rule "Fireworks" |
blocks |
(optional): groups for parameters |
pop |
: (matrix, nrow = nset, ncol = nvar or nvar+nobj ) optional, initial population (used to restart an optimization) |
funcinit |
(function, optional): the initialization function applied on each node of cluster when parallel computation. The arguments are cl and numcores |
objnames |
(optional): names of the objectives |
listsave |
(optional): names of the listing files. Default: None (no output). If exists, fields to be defined: "pmt" (file of parameters on the Pareto Front), "obj" (file of corresponding objective values), "evol" (evolution of maximum objectives by generation). Optional field: "totalpop" (total population and corresponding objectives, useful to restart a computation) |
write_gen |
: (logical, length = 1) optional, if TRUE, save files 'pmt' and 'obj' at each generation (FALSE by default) |
carallel |
: (integer, length = 1) optional, do parallel computations? (0: sequential, 1:parallel (default) , 2:user-defined choice) |
numcores |
: (integer, length = 1) optional, the number of cores for the parallel computations (all cores by default) |
graph |
: (logical, length = 1) optional, plot graphical output at each generation (TRUE by default) |
sensitivity |
: (logical, length = 1) optional, compute the first order derivatives of the pareto front (FALSE by default) |
verbose |
: (logical, length = 1) optional, verbosity mode (TRUE by default) |
worklist |
: optional values to be transmitted to the user's function (not used) |
The optimizer was originally written for Scilab by Nicolas Le Moine. The algorithm is a hybrid of the MEAS algorithm (Efstratiadis and Koutsoyiannis (2005) <doi:10.13140/RG.2.2.32963.81446>) by using the directional search method based on the simplexes of the objective space and the epsilon-NGSA-II algorithm with the method of classification of the parameter vectors archiving management by epsilon-dominance (Reed and Devireddy <doi:10.1142/9789812567796_0004>). Reference : "Multi-objective calibration by combination of stochastic and gradient-like parameter generation rules – the caRamel algorithm" Celine Monteil (EDF), Fabrice Zaoui (EDF), Nicolas Le Moine (UPMC) and Frederic Hendrickx (EDF) June 2020 Hydrology and Earth System Sciences 24(6):3189-3209 DOI: 10.5194/hess-24-3189-2020 Documentation : "Principe de l'optimiseur CaRaMEL et illustration au travers d'exemples de parametres dans le cadre de la modelisation hydrologique conceptuelle" Frederic Hendrickx (EDF) and Nicolas Le Moine (UPMC) Report EDF H-P73-2014-09038-FR
List of seven elements:
return value (logical, length = 1) : TRUE if successfull
Pareto front (matrix, nrow = archsize, ncol = nvar)
objectives of the Pareto front (matrix, nrow = archsize, ncol = nobj+nadditional)
list of the Jacobian matrices of the Pareto front if the sensitivity parameter is TRUE or NA otherwise
evolution of the optimal objectives
total population (matrix, nrow = popsize+archsize, ncol = nvar+nobj+nadditional)
the calling period for the third generation rule (independent sampling with a priori parameters variance)
Fabrice Zaoui - Celine Monteil
# Definition of the test function viennet <- function(i) { val1 <- 0.5*(x[i,1]*x[i,1]+x[i,2]*x[i,2])+sin(x[i,1]*x[i,1]+x[i,2]*x[i,2]) val2 <- 15+(x[i,1]-x[i,2]+1)*(x[i,1]-x[i,2]+1)/27+(3*x[i,1]-2*x[i,2]+4)*(3*x[i,1]-2*x[i,2]+4)/8 val3 <- 1/(x[i,1]*x[i,1]+x[i,2]*x[i,2]+1) -1.1*exp(-(x[i,1]*x[i,1]+x[i,2]*x[i,2])) return(c(val1,val2,val3)) } # Number of objectives nobj <- 3 # Number of variables nvar <- 2 # All the objectives are to be minimized minmax <- c(FALSE, FALSE, FALSE) # Define the bound constraints bounds <- matrix(data = 1, nrow = nvar, ncol = 2) bounds[, 1] <- -3 * bounds[, 1] bounds[, 2] <- 3 * bounds[, 2] # Caramel optimization results <- caRamel(nobj = nobj, nvar = nvar, minmax = minmax, bounds = bounds, func = viennet, popsize = 100, archsize = 100, maxrun = 500, prec = matrix(1.e-3, nrow = 1, ncol = nobj), carallel = 0)
# Definition of the test function viennet <- function(i) { val1 <- 0.5*(x[i,1]*x[i,1]+x[i,2]*x[i,2])+sin(x[i,1]*x[i,1]+x[i,2]*x[i,2]) val2 <- 15+(x[i,1]-x[i,2]+1)*(x[i,1]-x[i,2]+1)/27+(3*x[i,1]-2*x[i,2]+4)*(3*x[i,1]-2*x[i,2]+4)/8 val3 <- 1/(x[i,1]*x[i,1]+x[i,2]*x[i,2]+1) -1.1*exp(-(x[i,1]*x[i,1]+x[i,2]*x[i,2])) return(c(val1,val2,val3)) } # Number of objectives nobj <- 3 # Number of variables nvar <- 2 # All the objectives are to be minimized minmax <- c(FALSE, FALSE, FALSE) # Define the bound constraints bounds <- matrix(data = 1, nrow = nvar, ncol = 2) bounds[, 1] <- -3 * bounds[, 1] bounds[, 2] <- 3 * bounds[, 2] # Caramel optimization results <- caRamel(nobj = nobj, nvar = nvar, minmax = minmax, bounds = bounds, func = viennet, popsize = 100, archsize = 100, maxrun = 500, prec = matrix(1.e-3, nrow = 1, ncol = nobj), carallel = 0)
gives n new candidates by extrapolation along orthogonal directions to the Pareto front in the space of the objectives
Cextrap(param, crit, directions, longu, n)
Cextrap(param, crit, directions, longu, n)
param |
: matrix [ NPoints , NPar ] of already evaluated parameters |
crit |
: matrix [ Npoints , NObj ] of associated criteria |
directions |
: matrix [ NDir, 2 ] the starting and ending points of the candidate vectors |
longu |
: matrix [ NDir , 1 ] giving the length of each segment thus defined in the OBJ space (measure of the probability of exploring this direction) |
n |
: number of new vectors to generate |
xnew : matrix [ n , NPar ] of new vectors
pcrit : matrix [ n , NObj ] estimated positions of new sets in the goal space
Fabrice Zaoui
# Definition of the parameters param <- matrix(rexp(100), 100, 1) crit <- matrix(rexp(200), 100, 2) directions <- matrix(c(1,3,2,7,13,40), nrow = 3, ncol = 2) longu <- runif(3) n <- 5 # Call the function res <- Cextrap(param, crit, directions, longu, n)
# Definition of the parameters param <- matrix(rexp(100), 100, 1) crit <- matrix(rexp(200), 100, 2) directions <- matrix(c(1,3,2,7,13,40), nrow = 3, ncol = 2) longu <- runif(3) n <- 5 # Call the function res <- Cextrap(param, crit, directions, longu, n)
proposes n new candidates by interpolation in simplexes of the objective space
Cinterp(param, crit, simplices, volume, n)
Cinterp(param, crit, simplices, volume, n)
param |
: matrix [ NPoints , NPar ] of already evaluated parameters |
crit |
: matrix [ Npoints , NObj ] of associated criteria |
simplices |
: matrix [ NSimp , NObj+1 ] containing all or part of the triangulation of the space of the objectives |
volume |
: matrix [ NSimp , 1 ] giving the volume of each simplex (measure of the probability of interpolating in this simplex) |
n |
: number of new vectors to generate |
xnew : matrix [ n , NPar ] of new vectors
pcrit : matrix [ n , NObj ] estimated positions of new sets in the goal space
Fabrice Zaoui
# Definition of the parameters param <- matrix(rexp(100), 100, 1) crit <- matrix(rexp(200), 100, 2) simplices <- matrix(c(15,2,1,15,22,1,18,15,2,17,13,14), nrow = 4, ncol = 3) volume <- runif(4) n <- 5 # Call the function res <- Cinterp(param, crit, simplices, volume, n)
# Definition of the parameters param <- matrix(rexp(100), 100, 1) crit <- matrix(rexp(200), 100, 2) simplices <- matrix(c(15,2,1,15,22,1,18,15,2,17,13,14), nrow = 4, ncol = 3) volume <- runif(4) n <- 5 # Call the function res <- Cinterp(param, crit, simplices, volume, n)
performs a recombination of the sets of parameters
Crecombination(param, blocks, n)
Crecombination(param, blocks, n)
param |
: matrix [ . , NPar ] of the population of parameters |
blocks |
: list of integer vectors: list of variable blocks for recombination |
n |
: number of new vectors to generate |
xnew : matrix [ n , NPar ] of new vectors
Fabrice Zaoui
# Definition of the parameters param <- matrix(rexp(15), 15, 1) blocks <- NULL n <- 5 # Call the function res <- Crecombination(param, blocks, n)
# Definition of the parameters param <- matrix(rexp(15), 15, 1) blocks <- NULL n <- 5 # Call the function res <- Crecombination(param, blocks, n)
proposes new parameter vectors respecting a covariance structure
Cusecovar(xref, amplif, n)
Cusecovar(xref, amplif, n)
xref |
: matrix [ . , NPar ] of the reference population whose covariance structure is to be used |
amplif |
: amplification factor of the standard deviation on each parameter |
n |
: number of new vectors to generate |
xnew : matrix [ n , NPar ] of new vectors
Fabrice Zaoui
# Definition of the parameters xref <- matrix(rexp(35), 35, 1) amplif <- 2. n <- 5 # Call the function res <- Cusecovar(xref, amplif, n)
# Definition of the parameters xref <- matrix(rexp(35), 35, 1) amplif <- 2. n <- 5 # Call the function res <- Cusecovar(xref, amplif, n)
decreases the population of parameters sets
decrease_pop(matobj, minmax, prec, archsize, popsize)
decrease_pop(matobj, minmax, prec, archsize, popsize)
matobj |
: matrix of objectives, dimension (ngames, nobj) |
minmax |
: vector of booleans, of dimension nobj: TRUE if maximization of the objective, FALSE otherwise |
prec |
: nobj dimension vector: accuracy |
archsize |
: integer: archive size |
popsize |
: integer: population size |
A list containing two elements:
indices of individuals in the updated Pareto front
indices of individuals in the updated population
Fabrice Zaoui
# Definition of the parameters matobj <- matrix(rexp(200), 100, 2) prec <- c(1.e-3, 1.e-3) archsize <- 100 minmax <- c(FALSE, FALSE) popsize <- 100 # Call the function res <- decrease_pop(matobj, minmax, prec, archsize, popsize)
# Definition of the parameters matobj <- matrix(rexp(200), 100, 2) prec <- c(1.e-3, 1.e-3) archsize <- 100 minmax <- c(FALSE, FALSE) popsize <- 100 # Call the function res <- decrease_pop(matobj, minmax, prec, archsize, popsize)
determines directions for improvement
Dimprove(o_splx, f_splx)
Dimprove(o_splx, f_splx)
o_splx |
: matrix of objectives of simplexes (nrow = npoints, ncol = nobj) |
f_splx |
: vector (npoints) of associated Pareto numbers (1 = dominated) |
list of elements "oriedge": oriented edges and "ledge": length
Fabrice Zaoui
# Definition of the parameters o_splx <- matrix(rexp(6), 3, 2) f_splx <- c(1,1,1) # Call the function res <- Dimprove(o_splx, f_splx)
# Definition of the parameters o_splx <- matrix(rexp(6), 3, 2) f_splx <- c(1,1,1) # Call the function res <- Dimprove(o_splx, f_splx)
calculates the successive Pareto fronts of a population (classification "onion peel"), when objectives need to be maximized.
dominate(matobj)
dominate(matobj)
matobj |
: matrix [ NInd , NObj ] of objectives |
f : vector of dimension NInd of dominances
Alban de Lavenne, Fabrice Zaoui
# Definition of the parameters matobj <- matrix(runif(200), 100, 2) # Call the function pareto_rank <- dominate(matobj)
# Definition of the parameters matobj <- matrix(runif(200), 100, 2) # Call the function pareto_rank <- dominate(matobj)
indicates which rows of the matrix Y are dominated by the vector (row) x
dominated(x, Y)
dominated(x, Y)
x |
: row vecteur |
Y |
: matrix |
D : vector of booleans
Alban de Lavenne, Fabrice Zaoui
# Definition of the parameters Y <- matrix(rexp(200), 100, 2) x <- Y[1,] # Call the function res <- dominated(x, Y)
# Definition of the parameters Y <- matrix(rexp(200), 100, 2) x <- Y[1,] # Call the function res <- dominated(x, Y)
reduces the number of individuals in a population to only one individual per box up to a given accuracy
downsize(points, Fo, prec)
downsize(points, Fo, prec)
points |
: matrix of objectives |
Fo |
: rank on the front of each point (1: dominates on the Pareto) |
prec |
: (double, length = nobj) desired accuracy for sorting objectives |
vector indices
Fabrice Zaoui
# Definition of the parameters points <- matrix(rexp(200), 100, 2) prec <- c(1.e-3, 1.e-3) Fo <- sample(1:100, 100) # Call the function res <- downsize(points, Fo, prec)
# Definition of the parameters points <- matrix(rexp(200), 100, 2) prec <- c(1.e-3, 1.e-3) Fo <- sample(1:100, 100) # Call the function res <- downsize(points, Fo, prec)
calculates the variances-covariances matrix on the reference population
matvcov(x, g)
matvcov(x, g)
x |
: population |
g |
: center of reference population (in the parameter space) |
rr : variances-covariances matrix on the reference population
Fabrice Zaoui
# Definition of the parameters x <- matrix(rexp(30), 30, 1) g <- mean(x) # Call the function res <- matvcov(x, g)
# Definition of the parameters x <- matrix(rexp(30), 30, 1) g <- mean(x) # Call the function res <- matvcov(x, g)
generates a new population of parameter sets following the five rules of caRamel
newXval(param, crit, isperf, sp, bounds, repart_gene, blocks, fireworks)
newXval(param, crit, isperf, sp, bounds, repart_gene, blocks, fireworks)
param |
: matrix [ Nvec , NPar ] of parameters of the current population |
crit |
: matrix [ Nvec , NObj ] of associated criteria |
isperf |
: vector of Booleans of length NObj, TRUE if maximization of the objective, FALSE otherwise |
sp |
: variance a priori of the parameters |
bounds |
: lower and upper bounds of parameters [ NPar , 2 ] |
repart_gene |
: matrix of length 4 giving the number of games to be generated with each rule: 1 Interpolation in the simplexes of the front, 2 Extrapolation according to the directions of the edges "orthogonal" to the front, 3 Random draws with prescribed variance-covariance matrix, 4 Recombination by functional blocks |
blocks |
: list of integer vectors containing function blocks of parameters |
fireworks |
: boolean, TRUE if one tests a random variation on each parameter and each maximum of O.F. |
xnew : matrix of new vectors [ sum(Repart_Gene) + eventually (nobj+1)*nvar if fireworks , NPar ]
project_crit: assumed position of the new vectors in the criteria space: [ sum(Repart_Gene)+ eventually (nobj+1)*nvar if fireworks , NObj ];
Fabrice Zaoui
# Definition of the parameters param <- matrix(rexp(100), 100, 1) crit <- matrix(rexp(200), 100, 2) isperf <- c(FALSE, FALSE) bounds <- matrix(data = 1, nrow = 1, ncol = 2) bounds[, 1] <- -5 * bounds[, 1] bounds[, 2] <- 10 * bounds[, 2] sp <- (bounds[, 2] - bounds[, 1]) / (2 * sqrt(3)) repart_gene <- c(5, 5, 5, 5) fireworks <- TRUE blocks <- NULL # Call the function res <- newXval(param, crit, isperf, sp, bounds, repart_gene, blocks, fireworks)
# Definition of the parameters param <- matrix(rexp(100), 100, 1) crit <- matrix(rexp(200), 100, 2) isperf <- c(FALSE, FALSE) bounds <- matrix(data = 1, nrow = 1, ncol = 2) bounds[, 1] <- -5 * bounds[, 1] bounds[, 2] <- 10 * bounds[, 2] sp <- (bounds[, 2] - bounds[, 1]) / (2 * sqrt(3)) repart_gene <- c(5, 5, 5, 5) fireworks <- TRUE blocks <- NULL # Call the function res <- newXval(param, crit, isperf, sp, bounds, repart_gene, blocks, fireworks)
indicates which rows of the X criterion matrix are Pareto, when objectives need to be maximized
pareto(X)
pareto(X)
X |
: matrix of objectives [NInd * NObj] |
Ft : vector [NInd], TRUE when the set is on the Pareto front.
Alban de Lavenne, Fabrice Zaoui
# Definition of the parameters X <- matrix(runif(200), 100, 2) # Call the function is_pareto <- pareto(X)
# Definition of the parameters X <- matrix(runif(200), 100, 2) # Call the function is_pareto <- pareto(X)
Plot graphs of the Pareto front and a graph of optimization evolution
plot_caramel(caramel_results, nobj = NULL, objnames = NULL)
plot_caramel(caramel_results, nobj = NULL, objnames = NULL)
caramel_results |
: list resulting from the caRamel() function, with fields $objectives and $save_crit |
nobj |
: number of objectives (optional) |
objnames |
: vector of objectives names (optional) |
# Definition of the test function viennet <- function(i) { val1 <- 0.5*(x[i,1]*x[i,1]+x[i,2]*x[i,2])+sin(x[i,1]*x[i,1]+x[i,2]*x[i,2]) val2 <- 15+(x[i,1]-x[i,2]+1)*(x[i,1]-x[i,2]+1)/27+(3*x[i,1]-2*x[i,2]+4)*(3*x[i,1]-2*x[i,2]+4)/8 val3 <- 1/(x[i,1]*x[i,1]+x[i,2]*x[i,2]+1) -1.1*exp(-(x[i,1]*x[i,1]+x[i,2]*x[i,2])) return(c(val1,val2,val3)) } nobj <- 3 # Number of objectives nvar <- 2 # Number of variables minmax <- c(FALSE, FALSE, FALSE) # All the objectives are to be minimized bounds <- matrix(data = 1, nrow = nvar, ncol = 2) # Define the bound constraints bounds[, 1] <- -3 * bounds[, 1] bounds[, 2] <- 3 * bounds[, 2] # Caramel optimization results <- caRamel(nobj, nvar, minmax, bounds, viennet, popsize = 100, archsize = 100, maxrun = 500, prec = matrix(1.e-3, nrow = 1, ncol = nobj), carallel = FALSE) # Plot of results plot_caramel(results)
# Definition of the test function viennet <- function(i) { val1 <- 0.5*(x[i,1]*x[i,1]+x[i,2]*x[i,2])+sin(x[i,1]*x[i,1]+x[i,2]*x[i,2]) val2 <- 15+(x[i,1]-x[i,2]+1)*(x[i,1]-x[i,2]+1)/27+(3*x[i,1]-2*x[i,2]+4)*(3*x[i,1]-2*x[i,2]+4)/8 val3 <- 1/(x[i,1]*x[i,1]+x[i,2]*x[i,2]+1) -1.1*exp(-(x[i,1]*x[i,1]+x[i,2]*x[i,2])) return(c(val1,val2,val3)) } nobj <- 3 # Number of objectives nvar <- 2 # Number of variables minmax <- c(FALSE, FALSE, FALSE) # All the objectives are to be minimized bounds <- matrix(data = 1, nrow = nvar, ncol = 2) # Define the bound constraints bounds[, 1] <- -3 * bounds[, 1] bounds[, 2] <- 3 * bounds[, 2] # Caramel optimization results <- caRamel(nobj, nvar, minmax, bounds, viennet, popsize = 100, archsize = 100, maxrun = 500, prec = matrix(1.e-3, nrow = 1, ncol = nobj), carallel = FALSE) # Plot of results plot_caramel(results)
Plots graphs the population regarding each couple of objectives and emphasizes the Pareto front
plot_pareto(MatObj, nobj = NULL, objnames = NULL, maximized = NULL)
plot_pareto(MatObj, nobj = NULL, objnames = NULL, maximized = NULL)
MatObj |
: matrix of the objectives [NInd, nobj] |
nobj |
: number of objectives (optional) |
objnames |
: vector, length nobj, of names of the objectives (optional) |
maximized |
: vector of logical, length nobj, TRUE if objective need to be maximized, FALSE if minimized |
Celine Monteil
# Definition of the population Pop <- matrix(runif(300), 100, 3) # Definition of objectives to maximize (Obj1, Obj2) and to minimize (Obj3) maximized <- c(TRUE, TRUE, FALSE) # Call the function plot_pareto(MatObj = Pop, maximized = maximized)
# Definition of the population Pop <- matrix(runif(300), 100, 3) # Definition of objectives to maximize (Obj1, Obj2) and to minimize (Obj3) maximized <- c(TRUE, TRUE, FALSE) # Call the function plot_pareto(MatObj = Pop, maximized = maximized)
Plot graphs the population regarding each couple of objectives
plot_population( MatObj, nobj, ngen = NULL, nrun = NULL, objnames = NULL, MatEvol = NULL, popsize = 0 )
plot_population( MatObj, nobj, ngen = NULL, nrun = NULL, objnames = NULL, MatEvol = NULL, popsize = 0 )
MatObj |
: matrix of the objectives [NInd, nobj] |
nobj |
: number of objectives |
ngen |
: number of generations (optional) |
nrun |
: number of model evaluations (optional) |
objnames |
: vector of objectives names (optional) |
MatEvol |
: matrix of the evolution of the optimal objectives (optional) |
popsize |
: integer, size of the initial population (optional) |
Celine Monteil
# Definition of the population Pop <- matrix(runif(300), 100, 3) # Call the function plot_population(MatObj = Pop, nobj = 3, objnames = c("Obj1", "Obj2", "Obj3"))
# Definition of the population Pop <- matrix(runif(300), 100, 3) # Call the function plot_population(MatObj = Pop, nobj = 3, objnames = c("Obj1", "Obj2", "Obj3"))
performs a selection of n points in facp
rselect(n, facp)
rselect(n, facp)
n |
: number of points to select |
facp |
: vector of initial points |
ix : ranks of selected points (vector of dimension n)
Fabrice Zaoui
# Definition of the parameters n <- 5 facp <- runif(30) # Call the function res <- rselect(n, facp)
# Definition of the parameters n <- 5 facp <- runif(30) # Call the function res <- rselect(n, facp)
converts the values of a vector into their rank
val2rank(X, opt)
val2rank(X, opt)
X |
: vector to treat |
opt |
: integer which gives the rule to follow in case of tied ranks (repeated values): if opt = 1, one returns the average rank, if opt = 2, one returns the corresponding rank in the series of the unique values, if opt = 3, return the max rank |
R : rank vector
Fabrice Zaoui
# Definition of the parameters X <- matrix(rexp(100), 100, 1) opt <- 3 # Call the function res <- val2rank(X, opt)
# Definition of the parameters X <- matrix(rexp(100), 100, 1) opt <- 3 # Call the function res <- val2rank(X, opt)
calculates the volume of a simplex
vol_splx(S)
vol_splx(S)
S |
: matrix (d+1) rows * d columns containing the coordinates in d-dim of d + 1 vertices of a simplex |
V : simplex volume
Fabrice Zaoui
# Definition of the parameters S <- matrix(rexp(6), 3, 2) # Call the function res <- vol_splx(S)
# Definition of the parameters S <- matrix(rexp(6), 3, 2) # Call the function res <- vol_splx(S)