Package boxmin :: Module amoeba :: Class amoeba
[hide private]

Class amoeba

source code

Instance Methods [hide private]
 
__init__(self) source code
 
reset(self, p0, scale=0.5)
Reset the simplex to contain Po=[x_1,...,x_n].
source code
 
num_dimensions(self) source code
 
fit(self, ftol=None, xtol=None, maxiter=None, maxfun=None, restart=0, scale=0.1)
Find the minimum of the function.
source code
 
step(self)
Perform a single simplex transformation.
source code
 
setup(self, func, p0, bounds=[])
Create an amoeba fit object using function func.
source code
Method Details [hide private]

reset(self, p0, scale=0.5)

source code 
Reset the simplex to contain Po=[x_1,...,x_n]. Scale sets the size of the simplex.

fit(self, ftol=None, xtol=None, maxiter=None, maxfun=None, restart=0, scale=0.1)

source code 

Find the minimum of the function.

Halt when the function is flat to within ftol, or itmax iterations have been exceeded. If restart>0, restart the fit that many times basing each new fit off the best value from the last fit. The new simplex is of size scale in [0,1]. Use restart=-1 to run the fit until it stops improving.

Returns [P, fval, iteration, fcalls]: P: the fit parameter vector fval: the value of the function for the best fit value. iterations: the number of iterations. fcalls: the number of function calls.

step(self)

source code 

Perform a single simplex transformation.

Returns [P, fvalv, terminate], where P: The parameter vector, fval: The function value at the best vertex, stopFlag: Whether flatness is less than tolerance.

E.g.:

for i in range(100):
    [P, fval, stop] = fit.step()
    if stop: break

setup(self, func, p0, bounds=[])

source code 
Create an amoeba fit object using function func. Bounds should be a list of values like [lo_1, lo_2, ... lo_n, hi_1, hi_2, ..., hi_n] setting the minimum and maximum for each dimension.