optimize.tests.test_optimize

Unit tests for optimization routines from optimize.py

Authors:
Ed Schofield, Nov 2005 Andrew Straw, April 2008
To run it in its simplest form::
nosetests test_optimize.py

Module Contents

Functions

test_check_grad()
test_neldermead_xatol_fatol()
test_brent_negative_tolerance()
himmelblau(p) R^2 -> R^1 test function for optimization. The function has four local
himmelblau_grad(p)
himmelblau_hess(p)
test_minimize_multiple_constraints()
test_check_grad()
class CheckOptimize

Base test case for a simple constrained entropy maximization problem (the machine translation example of Berger et al in Computational Linguistics, vol 22, num 1, pp 39–72, 1996.)

setup_method()
func(x)
grad(x)
hess(x)
hessp(x, p)
class CheckOptimizeParameterized
test_cg()
test_cg_cornercase()
test_bfgs()
test_bfgs_infinite()
test_powell()
test_neldermead()
test_neldermead_initial_simplex()
test_neldermead_initial_simplex_bad()
test_ncg_negative_maxiter()
test_ncg()
test_ncg_hess()
test_ncg_hessp()
test_neldermead_xatol_fatol()
class TestOptimizeWrapperDisp
class TestOptimizeWrapperNoDisp
class TestOptimizeNoWrapperDisp
class TestOptimizeNoWrapperNoDisp
class TestOptimizeSimple
test_bfgs_nan()
test_bfgs_nan_return()
test_bfgs_numerical_jacobian()
test_bfgs_gh_2169()
test_l_bfgs_b()
test_l_bfgs_b_numjac()
test_l_bfgs_b_funjac()
test_minimize_l_bfgs_b()
test_minimize_l_bfgs_b_ftol()
test_minimize_l_bfgs_maxls()
test_minimize_l_bfgs_b_maxfun_interruption()
test_custom()
test_minimize_tol_parameter()
test_no_increase(method)
test_slsqp_respect_bounds()
test_minimize_automethod()
test_minimize_coerce_args_param()
test_initial_step_scaling()
class TestLBFGSBBounds
setup_method()
fun(x, p=2.0)
jac(x, p=2.0)
fj(x, p=2.0)
test_l_bfgs_b_bounds()
test_l_bfgs_b_funjac()
test_minimize_l_bfgs_b_bounds()
class TestOptimizeScalar
setup_method()
fun(x, a=1.5)

Objective function

test_brent()
test_golden()
test_fminbound()
test_fminbound_scalar()
test_minimize_scalar()
test_minimize_scalar_custom()
test_minimize_scalar_coerce_args_param()
test_brent_negative_tolerance()
class TestNewtonCg
test_rosenbrock()
test_himmelblau()
class TestRosen
test_hess()
himmelblau(p)

R^2 -> R^1 test function for optimization. The function has four local minima where himmelblau(xopt) == 0.

himmelblau_grad(p)
himmelblau_hess(p)
test_minimize_multiple_constraints()
class TestOptimizeResultAttributes
setup_method()
test_attributes_present()
class TestBrute
setup_method()
f1(z, *params)
f2(z, *params)
f3(z, *params)
func(z, *params)
test_brute()
class TestIterationLimits
setup_method()
slow_func(v)
test_neldermead_limit()
test_powell_limit()
check_limits(method, default_iters)