Skip to content
SpecializedSource checked

CMA-ES

Optimizes continuous functions by adapting a Gaussian search distribution.

Quick Facts

Compact metadata for implementation and discovery.

Category
Optimization
Difficulty
Advanced
Family
Evolution Strategy
Tier
Specialized
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
2
Code example
Ready
Visualization
Ready
Aliases
Covariance Matrix Adaptation Evolution Strategy

Overview

CMA-ES samples candidate solutions from a multivariate normal distribution and updates its mean and covariance to follow successful search directions.

Core Concepts

covariance adaptationsearch distributionevolution pathcontinuous optimization

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(n^2)

Average

O(iterations * population * n^2)

Worst

O(iterations * population * n^2)

Space

O(n^2)

When to Use

  • Use when tuning model parameters needs covariance adaptation.
  • Use when the input matches the assumptions behind evolution Strategy.

When Not to Use

  • Avoid when the objective is cheap and convex enough for a simpler exact solver.
  • Avoid when a simpler algorithm gives the required result with less setup.

What It Does

  • Optimizes continuous functions by adapting a Gaussian search distribution
  • Uses covariance adaptation and search distribution to guide the work.
  • Produces best candidate.

Use Cases

  • Tuning model parameters
  • Searching design spaces
  • Fitting models to noisy data

Inputs

  • Objective function
  • Initial candidate or population
  • Stopping rule

Outputs

  • Best candidate
  • Objective value
  • Search history

Key Formulas (1)

Sampling rule

xk = mean + σ · Normal(0, C)
x_k = mean + sigma * Normal(0, C)

Draws candidates from the current covariance-shaped search distribution.

Pseudocode

  1. 1.Prepare the inputs and state needed for CMA-ES.
  2. 2.Apply the covariance adaptation step while the stopping condition has not been met.
  3. 3.Update intermediate state and discard invalid candidates.
  4. 4.Return best candidate.

Canonical Example

Input
CMA-ES input with a small representative case
Output
Best candidate
Explanation
CMA-ES applies covariance adaptation to produce best candidate.

Implementation Notes

  • Track both best-so-far and current candidate state.
  • Keep the covariance adaptation step separate enough to test independently.

Common Pitfalls

  • Stopping too early can make a poor local result look like convergence.
  • Forgetting to check edge cases can make CMA-ES look correct on only ideal inputs.

Interactive Mechanism Walkthrough

Iterative Convergence & State Trajectory

Plot candidate points, objective values, and improvement steps across iterations.

CMA-ES mechanism walkthrough step 1 of 4x₀x₁x₂x*
Step 1 of 4: Prepare the inputs and state needed for CMA-ES.
optimization-mechanism

Notes

CMA-ES is powerful for derivative-free continuous optimization but can become expensive as dimensionality grows.

Sources (1)

What each reference supports for this entry.

CMA-ES tutorial

Paper

Tutorial reference for covariance matrix adaptation evolution strategy.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Both are derivative-free optimizers for continuous spaces.

Conceptual neighborGenetic Algorithm

CMA-ES is an evolutionary strategy rather than a crossover-focused genetic algorithm.

Tags

OptimizationEvolution StrategyPopulation BasedStochastic