SciPy 0.6.0 API Documentation Generated by Endo, 2007-10-17
error = _minpack.error
Bisection root-finding method. Given a function and an interval with
func(a) * func(b) < 0, find the root between a and b.
See also:
fmin, fmin_powell, fmin_cg,
fmin_bfgs, fmin_ncg -- multivariate local optimizers
leastsq -- nonlinear least squares minimizer
fmin_l_bfgs_b, fmin_tnc,
fmin_cobyla -- constrained multivariate optimizers
anneal, brute -- global optimizers
fminbound, brent, golden, bracket -- local scalar minimizers
fsolve -- n-dimenstional root-finding
brentq, brenth, ridder, bisect, newton -- one-dimensional root-finding
fixed_point -- scalar fixed-point finder
Perform a simple check on the gradient for correctness.
Given a function of one variable and a starting point, find a
fixed-point of the function: i.e. where func(x)=x.
See also:
fmin, fmin_powell, fmin_cg,
fmin_bfgs, fmin_ncg -- multivariate local optimizers
leastsq -- nonlinear least squares minimizer
fmin_l_bfgs_b, fmin_tnc,
fmin_cobyla -- constrained multivariate optimizers
anneal, brute -- global optimizers
fminbound, brent, golden, bracket -- local scalar minimizers
fsolve -- n-dimenstional root-finding
brentq, brenth, ridder, bisect, newton -- one-dimensional root-finding
fixed_point -- scalar fixed-point finder
Find the roots of a function.
Description:
Return the roots of the (non-linear) equations defined by
func(x)=0 given a starting estimate.
Inputs:
func -- A Python function or method which takes at least one
(possibly vector) argument.
x0 -- The starting estimate for the roots of func(x)=0.
args -- Any extra arguments to func are placed in this tuple.
fprime -- A function or method to compute the Jacobian of func with
derivatives across the rows. If this is None, the
Jacobian will be estimated.
full_output -- non-zero to return the optional outputs.
col_deriv -- non-zero to specify that the Jacobian function
computes derivatives down the columns (faster, because
there is no transpose operation).
warning -- True to print a warning message when the call is
unsuccessful; False to suppress the warning message.
Outputs: (x, {infodict, ier, mesg})
x -- the solution (or the result of the last iteration for an
unsuccessful call.
infodict -- a dictionary of optional outputs with the keys:
'nfev' : the number of function calls
'njev' : the number of jacobian calls
'fvec' : the function evaluated at the output
'fjac' : the orthogonal matrix, q, produced by the
QR factorization of the final approximate
Jacobian matrix, stored column wise.
'r' : upper triangular matrix produced by QR
factorization of same matrix.
'qtf' : the vector (transpose(q) * fvec).
ier -- an integer flag. If it is equal to 1 the solution was
found. If it is not equal to 1, the solution was not
found and the following message gives more information.
mesg -- a string message giving information about the cause of
failure.
Extended Inputs:
xtol -- The calculation will terminate if the relative error
between two consecutive iterates is at most xtol.
maxfev -- The maximum number of calls to the function. If zero,
then 100*(N+1) is the maximum where N is the number
of elements in x0.
band -- If set to a two-sequence containing the number of sub-
and superdiagonals within the band of the Jacobi matrix,
the Jacobi matrix is considered banded (only for fprime=None).
epsfcn -- A suitable step length for the forward-difference
approximation of the Jacobian (for fprime=None). If
epsfcn is less than the machine precision, it is assumed
that the relative errors in the functions are of
the order of the machine precision.
factor -- A parameter determining the initial step bound
(factor * || diag * x||). Should be in interval (0.1,100).
diag -- A sequency of N positive entries that serve as a
scale factors for the variables.
Remarks:
"fsolve" is a wrapper around MINPACK's hybrd and hybrj algorithms.
See also:
fmin, fmin_powell, fmin_cg,
fmin_bfgs, fmin_ncg -- multivariate local optimizers
leastsq -- nonlinear least squares minimizer
fmin_l_bfgs_b, fmin_tnc,
fmin_cobyla -- constrained multivariate optimizers
anneal, brute -- global optimizers
fminbound, brent, golden, bracket -- local scalar minimizers
fsolve -- n-dimenstional root-finding
brentq, brenth, ridder, bisect, newton -- one-dimensional root-finding
fixed_point -- scalar fixed-point finder
Minimize the sum of squares of a set of equations.
Description:
Return the point which minimizes the sum of squares of M
(non-linear) equations in N unknowns given a starting estimate, x0,
using a modification of the Levenberg-Marquardt algorithm.
x = arg min(sum(func(y)**2,axis=0))
y
Inputs:
func -- A Python function or method which takes at least one
(possibly length N vector) argument and returns M
floating point numbers.
x0 -- The starting estimate for the minimization.
args -- Any extra arguments to func are placed in this tuple.
Dfun -- A function or method to compute the Jacobian of func with
derivatives across the rows. If this is None, the
Jacobian will be estimated.
full_output -- non-zero to return all optional outputs.
col_deriv -- non-zero to specify that the Jacobian function
computes derivatives down the columns (faster, because
there is no transpose operation).
warning -- True to print a warning message when the call is
unsuccessful; False to suppress the warning message.
Outputs: (x, {cov_x, infodict, mesg}, ier)
x -- the solution (or the result of the last iteration for an
unsuccessful call.
cov_x -- uses the fjac and ipvt optional outputs to construct an
estimate of the covariance matrix of the solution.
None if a singular matrix encountered (indicates
infinite covariance in some direction).
infodict -- a dictionary of optional outputs with the keys:
'nfev' : the number of function calls
'njev' : the number of jacobian calls
'fvec' : the function evaluated at the output
'fjac' : A permutation of the R matrix of a QR
factorization of the final approximate
Jacobian matrix, stored column wise.
Together with ipvt, the covariance of the
estimate can be approximated.
'ipvt' : an integer array of length N which defines
a permutation matrix, p, such that
fjac*p = q*r, where r is upper triangular
with diagonal elements of nonincreasing
magnitude. Column j of p is column ipvt(j)
of the identity matrix.
'qtf' : the vector (transpose(q) * fvec).
mesg -- a string message giving information about the cause of failure.
ier -- an integer flag. If it is equal to 1 the solution was
found. If it is not equal to 1, the solution was not
found and the following message gives more information.
Extended Inputs:
ftol -- Relative error desired in the sum of squares.
xtol -- Relative error desired in the approximate solution.
gtol -- Orthogonality desired between the function vector
and the columns of the Jacobian.
maxfev -- The maximum number of calls to the function. If zero,
then 100*(N+1) is the maximum where N is the number
of elements in x0.
epsfcn -- A suitable step length for the forward-difference
approximation of the Jacobian (for Dfun=None). If
epsfcn is less than the machine precision, it is assumed
that the relative errors in the functions are of
the order of the machine precision.
factor -- A parameter determining the initial step bound
(factor * || diag * x||). Should be in interval (0.1,100).
diag -- A sequency of N positive entries that serve as a
scale factors for the variables.
Remarks:
"leastsq" is a wrapper around MINPACK's lmdif and lmder algorithms.
See also:
fmin, fmin_powell, fmin_cg,
fmin_bfgs, fmin_ncg -- multivariate local optimizers
leastsq -- nonlinear least squares minimizer
fmin_l_bfgs_b, fmin_tnc,
fmin_cobyla -- constrained multivariate optimizers
anneal, brute -- global optimizers
fminbound, brent, golden, bracket -- local scalar minimizers
fsolve -- n-dimenstional root-finding
brentq, brenth, ridder, bisect, newton -- one-dimensional root-finding
fixed_point -- scalar fixed-point finder
Given a function of a single variable and a starting point,
find a nearby zero using Newton-Raphson.
fprime is the derivative of the function. If not given, the
Secant method is used.
See also:
fmin, fmin_powell, fmin_cg,
fmin_bfgs, fmin_ncg -- multivariate local optimizers
leastsq -- nonlinear least squares minimizer
fmin_l_bfgs_b, fmin_tnc,
fmin_cobyla -- constrained multivariate optimizers
anneal, brute -- global optimizers
fminbound, brent, golden, bracket -- local scalar minimizers
fsolve -- n-dimenstional root-finding
brentq, brenth, ridder, bisect, newton -- one-dimensional root-finding
fixed_point -- scalar fixed-point finder
| Local name | Refers to |
|---|---|
| atleast_1d | numpy.atleast_1d |
| dot | numpy.dot |
| eye | numpy.eye |
| greater | numpy.greater |
| product | numpy.product |
| shape | numpy.shape |
| take | numpy.take |
| transpose | numpy.transpose |
| triu | numpy.triu |
| zeros | numpy.zeros |
| _minpack | SciPy.optimize._minpack |