rosenbrock: Calculate the Rosenbrock function

Description Usage Arguments Details Functions

View source: R/testfuns.R

Description

The Rosenbrock function is a function that is constructed to be difficult to minimize due to its shape. In two dimensions the function is shaped like a long, narrow, curving valley. The global minimum is at the lowest point in the valley. It is the dramatic difference in slope between the directions along and across the valley that makes it so hard to find the minimum. Therefore, it is often used as a test of optimizers or of Monte Carlo Samplers.

Usage

1
2
3

Arguments

x

Vector of input values. The dimension of the function will be inferred from the length of this vector.

Details

In two dimensions the definition of the Rosenbrock function is

(1-x)^2 + 100(y-x^2)^2.

In higher dimensions this generalizes to

∑_{i=1}^{N-1} 100(x_{i+1} - x_i^2)^2 + (1-x_i)^2.

The 2-D case has a minimum at (1,1). The 3-D case has a similar minimum at (1,1,1). For 4≤ N≤ 7, there is still a global minimum at (1,1, …, 1), but there is also a second local minimum at (-1, 1, 1, …, 1).

Functions


JGCRI/metrosamp documentation built on Aug. 8, 2019, 10:59 p.m.