| Title: | Estimation of Multivariate Normal Algorithm |
|---|---|
| Description: | Implements the Estimation of Multivariate Normal Algorithm (EMNA), an Estimation of Distribution Algorithm (EDA) for continuous optimization problems. The method iteratively selects the best individuals from a population, estimates the multivariate normal distribution of these selected individuals, and generates new candidate solutions by sampling from the estimated distribution. This process allows the probability model to adapt toward promising regions of the search space. The implementation includes an option to slow down convergence, along with an optional explicit exploration strategy for population initialization. This explicit exploration strategy is described in Salinas-Gutierrez and Muñoz-Zavala (2023) <doi:10.1016/j.asoc.2023.110230>. |
| Authors: | Rogelio Salinas Gutiérrez [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-1669-4460>), Manuel Alonso Segoviano Baltazar [aut, cph] (ORCID: <https://orcid.org/0009-0007-1494-7472>), Jhon Daniel Aguilar Payares [aut, cph] (ORCID: <https://orcid.org/0009-0009-6509-4486>), Juan Alberto Dávila del Alto [aut, cph] (ORCID: <https://orcid.org/0009-0007-2798-6251>), Jonathan Michell Jauregui Carranza [aut, cph] (ORCID: <https://orcid.org/0009-0005-2688-8065>), Hiram Efraim Macias Ruelas [aut, cph] (ORCID: <https://orcid.org/0009-0009-3847-159X>), Byron Axel Morales Gutiérrez [aut, cph] (ORCID: <https://orcid.org/0009-0006-3446-3830>), María Fernanda Nieto Guerrero [aut, cph] (ORCID: <https://orcid.org/0009-0000-1738-1733>), Pedro Abraham Montoya Calzada [aut, cph] (ORCID: <https://orcid.org/0009-0002-3497-210X>) |
| Maintainer: | Rogelio Salinas Gutiérrez <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-11-14 07:00:40 UTC |
| Source: | https://github.com/cran/EMNA |
An Estimation of Distribution Algorithm (EDA) that models a population using a multivariate normal distribution.
EMNA(fn, lower, upper, n, d, iter=100, eeea = TRUE,alpha=NULL,epsilon=NULL)EMNA(fn, lower, upper, n, d, iter=100, eeea = TRUE,alpha=NULL,epsilon=NULL)
fn |
A function representing the objective function to be minimized. The function must receive a numeric vector which represents an individual and return a numeric fitness value. |
lower |
Lower bounds for the variables. A single numeric value can be
provided and will be replicated across all |
upper |
Upper bounds for the variables. A single numeric value can be
provided and will be replicated across all |
n |
The population size. Must be a positive integer indicating the number of individuals generated in each iteration. |
d |
The dimensionality of the optimization problem, corresponding to the number of variables in each individual. |
iter |
The number of generations or iterations of the algorithm, it must be provided, default value is based at 100. |
eeea |
Selecte whether to use EEEA (Explicit Exploration Strategy for Evolutionary Algorithms) to generate the initial population ( |
alpha |
A convergence speed control parameter used a lineal combination of the new and old poblation whith alpha as parameter of porpotion. Higher values correspond to faster convergence. If this value is |
epsilon |
A tolerance threshold parameter for distribution changes. It represents the maximum allowable limit for the Kullback-Leibler divergence |
par |
Best population obtained by the estimation at the end. |
value |
Values of the best population obtained by the estimation at the end. |
If both alpha and epsilon are assigned a value, the function employs the slow-convergence method that utilizes alpha.
Rogelio Salinas Gutiérrez, Manuel Alonso Segoviano Baltazar, Jhon Daniel Aguilar Payares, Juan Alberto Dávila del Alto, Jonathan Michell Jauregui CarranzA, Hiram Efraim Macias Ruelas, Byron Axel Morales Gutiérrez, María Fernanda Nieto Guerrero, Pedro Abraham Montoya Calzada.
Larranaga, P. and Lozano, J. A. (2002). Estimation of Distribution Algorithms: A New Tool for Evolutionary Computation. Kluwer Academic Publishers.
https://CRAN.R-project.org/package=EEEA
# Sphere objective function sphere <- function(x) { return(sum(x^2)) } # Run EMNA using set.seed(123) result <- EMNA( fn = sphere, lower = -50, upper = 50, n = 20, d = 2, iter = 100, eeea = FALSE, alpha=NULL, epsilon=2.5) # Best individual result$par # Best objective function value result$value# Sphere objective function sphere <- function(x) { return(sum(x^2)) } # Run EMNA using set.seed(123) result <- EMNA( fn = sphere, lower = -50, upper = 50, n = 20, d = 2, iter = 100, eeea = FALSE, alpha=NULL, epsilon=2.5) # Best individual result$par # Best objective function value result$value
Computes the Kullback-Leibler divergence between two multivariate normal distributions with given mean vectors and covariance matrices.
kldivergence(mu1, sigma1, mu2, sigma2)kldivergence(mu1, sigma1, mu2, sigma2)
mu1 |
A numeric vector representing the mean of the first (reference) multivariate normal distribution. |
sigma1 |
A symmetric positive-definite numeric matrix representing the covariance matrix of the first distribution. Its dimension must match the length of |
mu2 |
A numeric vector representing the mean of the second (approximating) multivariate normal distribution. Its length must match the length of |
sigma2 |
A symmetric positive-definite numeric matrix representing the covariance matrix of the second distribution. Its dimension must match the length of |
Given two multivariate normal distributions
of dimension , the Kullback-Leibler divergence of from is given by
The function evaluates this expression directly from the provided means and covariances. The parameter is taken as the length of mu1.
The KL divergence is non-negative and equals zero if and only if and . It is not symmetric, i.e., in general.
For the formula to be valid, both sigma1 and sigma2 must be symmetric and positive-definite, so that their inverses and determinants are well-defined.
A numeric scalar giving the Kullback-Leibler divergence .
Rogelio Salinas Gutiérrez, Manuel Alonso Segoviano Baltazar, Jhon Daniel Aguilar Payares, Juan Alberto Dávila del Alto, Jonathan Michell Jauregui CarranzA, Hiram Efraim Macias Ruelas, Byron Axel Morales Gutiérrez, María Fernanda Nieto Guerrero, Pedro Abraham Montoya Calzada.
Cover, T. M., & Thomas, J. A. (1991). Elements of Information Theory. John Wiley & Sons.
# Bivariate case mu1 <- c(0, 0) mu2 <- c(1, -1) sigma1 <- matrix(c(1, 0.2, 0.2, 1), nrow = 2) sigma2 <- matrix(c(2, 0.1, 0.1, 1.5), nrow = 2) kldivergence(mu1, sigma1, mu2, sigma2) # Multivariate case mu1<-c(1,-1,2,0) mu2<-c(0,0,1,2) sigma1 <- matrix(c(3,0.5,0.2,0.1,0.5,2,0.3,0.2,0.2,0.3,4,0.5,0.1,0.2,0.5,1.5),4,4,byrow = TRUE) sigma2 <- matrix(c(2,0.1,0.1,0,0.1,1.5,0.2,0.1,0.1,0.2,2.5,0.3,0,0.1,0.3,2),4,4,byrow = TRUE) # kldivergence = 0 kldivergence(mu1,sigma1,mu1,sigma1) # kldivergence is not symetric kldivergence(mu1,sigma1,mu2,sigma2) kldivergence(mu2,sigma2,mu1,sigma1)# Bivariate case mu1 <- c(0, 0) mu2 <- c(1, -1) sigma1 <- matrix(c(1, 0.2, 0.2, 1), nrow = 2) sigma2 <- matrix(c(2, 0.1, 0.1, 1.5), nrow = 2) kldivergence(mu1, sigma1, mu2, sigma2) # Multivariate case mu1<-c(1,-1,2,0) mu2<-c(0,0,1,2) sigma1 <- matrix(c(3,0.5,0.2,0.1,0.5,2,0.3,0.2,0.2,0.3,4,0.5,0.1,0.2,0.5,1.5),4,4,byrow = TRUE) sigma2 <- matrix(c(2,0.1,0.1,0,0.1,1.5,0.2,0.1,0.1,0.2,2.5,0.3,0,0.1,0.3,2),4,4,byrow = TRUE) # kldivergence = 0 kldivergence(mu1,sigma1,mu1,sigma1) # kldivergence is not symetric kldivergence(mu1,sigma1,mu2,sigma2) kldivergence(mu2,sigma2,mu1,sigma1)