SciPy

scipy.optimize.rosen

scipy.optimize.rosen(x)[source]

The Rosenbrock function.

The function computed is:

sum(100.0*(x[1:] - x[:-1]**2.0)**2.0 + (1 - x[:-1])**2.0)
Parameters
xarray_like

1-D array of points at which the Rosenbrock function is to be computed.

Returns
ffloat

The value of the Rosenbrock function.

Examples

>>> from scipy.optimize import rosen
>>> X = 0.1 * np.arange(10)
>>> rosen(X)
76.56

Previous topic

scipy.optimize.HessianUpdateStrategy.update

Next topic

scipy.optimize.rosen_der