Skip to main content

rayleigh

Function rayleigh 

pub fn rayleigh(cov: &[Vec<f64>], direction: &[f64]) -> f64
Expand description

The Rayleigh quotient uᵀ C u / uᵀu — how much variance the covariance C carries along the direction u.

1 for C = I whatever u is, so the quotient reads directly as “how many times more (or less) than an isotropic distribution”. This is what turns “CMA-ES scored better” into “CMA-ES stretched its search distribution along the landscape’s flat axis”, which is the mechanism the headline claims.

The covariance lives in the unit hypercube while Landscape::flat_direction is in problem coordinates — but every landscape gives all its coordinates the same [low, high], so the two frames differ by a single global scale factor, which the quotient’s own normalization cancels. A direction can therefore be handed straight across.