Rosenbrock function

Plot of the Rosenbrock function of two variables. Here ${\displaystyle a=1,b=100}$, and the minimum value of zero is at ${\displaystyle (1,1)}$.

In mathematical optimization, the Rosenbrock function is a non-convex function, introduced by Howard H. Rosenbrock in 1960, which is used as a performance test problem for optimization algorithms.[1] It is also known as Rosenbrock's valley or Rosenbrock's banana function.

The global minimum is inside a long, narrow, parabolic shaped flat valley. To find the valley is trivial. To converge to the global minimum, however, is difficult.

The function is defined by

${\displaystyle f(x,y)=(a-x)^{2}+b(y-x^{2})^{2}}$

It has a global minimum at ${\displaystyle (x,y)=(a,a^{2})}$, where ${\displaystyle f(x,y)=0}$. Usually, these parameters are set such that ${\displaystyle a=1}$ and ${\displaystyle b=100}$. Only in the trivial case where ${\displaystyle a=0}$ the function is symmetric and the minimum is at the origin.

Multidimensional generalisations

Two variants are commonly encountered.

Animation of Rosenbrock's function of three variables. [2]

One is the sum of ${\displaystyle N/2}$ uncoupled 2D Rosenbrock problems, and is defined only for even ${\displaystyle N}$s:

${\displaystyle f(\mathbf {x} )=f(x_{1},x_{2},\dots ,x_{N})=\sum _{i=1}^{N/2}\left[100(x_{2i-1}^{2}-x_{2i})^{2}+(x_{2i-1}-1)^{2}\right].}$[3]

This variant has predictably simple solutions.

A second, more involved variant is

${\displaystyle f(\mathbf {x} )=\sum _{i=1}^{N-1}[100(x_{i+1}-x_{i}^{2})^{2}+(1-x_{i})^{2}]\quad {\mbox{where}}\quad \mathbf {x} =(x_{1},\ldots ,x_{N})\in \mathbb {R} ^{N}.}$[4]

has exactly one minimum for ${\displaystyle N=3}$ (at ${\displaystyle (1,1,1)}$) and exactly two minima for ${\displaystyle 4\leq N\leq 7}$—the global minimum of all ones and a local minimum near ${\displaystyle {\hat {\mathbf {x} }}=(-1,1,\dots ,1)}$. This result is obtained by setting the gradient of the function equal to zero, noticing that the resulting equation is a rational function of ${\displaystyle x}$. For small ${\displaystyle N}$ the polynomials can be determined exactly and Sturm's theorem can be used to determine the number of real roots, while the roots can be bounded in the region of ${\displaystyle |x_{i}|<2.4}$.[5] For larger ${\displaystyle N}$ this method breaks down due to the size of the coefficients involved.

Stationary points

Many of the stationary points of the function exhibit a regular pattern when plotted.[5] This structure can be exploited to locate them.

Rosenbrock roots exhibiting hump structures

Optimization examples

Nelder-Mead method applied to the Rosenbrock function

The Rosenbrock function can be efficiently optimized by adapting appropriate coordinate system without using any gradient information and without building local approximation models (in contrast to many derivate-free optimizers). The following figure illustrates an example of 2-dimensional Rosenbrock function optimization by adaptive coordinate descent from starting point ${\displaystyle x_{0}=(-3,-4)}$. The solution with the function value ${\displaystyle 10^{-10}}$ can be found after 325 function evaluations.

Using the Nelder–Mead method from starting point ${\displaystyle x_{0}=(-1,1)}$ with a regular initial simplex a minimum is found with function value ${\displaystyle 1.36\cdot 10^{-10}}$ after 185 function evaluations. The figure below visualizes the evolution of the algorithm.