Skip to content

Commit

Permalink
ENH: optimize: rename rhoend -> tol in cobyla
Browse files Browse the repository at this point in the history
The name `rhoend` is rather confusing for what essentially is
a tolerance.
  • Loading branch information
pv committed Jun 9, 2012
1 parent 481c07c commit 535b17c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions scipy/optimize/cobyla.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def fmin_cobyla(func, x0, cons, args=(), consargs=None, rhobeg=1.0, rhoend=1e-4,
if disp is not None:
iprint = disp
opts = {'rhobeg': rhobeg,
'rhoend': rhoend,
'tol': rhoend,
'iprint': iprint,
'disp' : iprint != 0,
'maxiter': maxfun}
Expand All @@ -166,7 +166,7 @@ def fmin_cobyla(func, x0, cons, args=(), consargs=None, rhobeg=1.0, rhoend=1e-4,
**opts)['x']

def _minimize_cobyla(fun, x0, args=(), constraints=(),
rhobeg=1.0, rhoend=1e-4, iprint=1, maxiter=1000,
rhobeg=1.0, tol=1e-4, iprint=1, maxiter=1000,
disp=False, **unknown_options):
"""
Minimize a scalar function of one or more variables using the
Expand All @@ -175,7 +175,7 @@ def _minimize_cobyla(fun, x0, args=(), constraints=(),
Options for the COBYLA algorithm are:
rhobeg : float
Reasonable initial changes to the variables.
rhoend : float
tol : float
Final accuracy in the optimization (not precisely guaranteed).
This is a lower bound on the size of the trust region.
disp : bool
Expand All @@ -189,6 +189,7 @@ def _minimize_cobyla(fun, x0, args=(), constraints=(),
"""
_check_unknown_options(unknown_options)
maxfun = maxiter
rhoend = tol
if not disp:
iprint = 0

Expand Down
2 changes: 1 addition & 1 deletion scipy/optimize/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2420,7 +2420,7 @@ def show_options(solver, method=None):
* COBYLA options:
rhobeg : float
Reasonable initial changes to the variables.
rhoend : float
tol : float
Final accuracy in the optimization (not precisely guaranteed).
This is a lower bound on the size of the trust region.
maxfev : int
Expand Down

0 comments on commit 535b17c

Please sign in to comment.