Unconstrained minimization of a function using the Newton-CG method.
Parameters : | f : callable f(x,*args)
x0 : ndarray
fprime : callable f’(x,*args)
fhess_p : callable fhess_p(x,p,*args), optional
fhess : callable fhess(x,*args), optional
args : tuple, optional
epsilon : float or ndarray, optional
callback : callable, optional
|
---|---|
Returns : | xopt : ndarray
fopt : float
fcalls : int
gcalls : int
hcalls : int
warnflag : int
allvecs : list
|
Other Parameters: | |
avextol : float
maxiter : int
full_output : bool
disp : bool
retall : bool
|
See also
Notes
Only one of fhess_p or fhess need to be given. If fhess is provided, then fhess_p will be ignored. If neither fhess nor fhess_p is provided, then the hessian product will be approximated using finite differences on fprime. fhess_p must compute the hessian times an arbitrary vector. If it is not given, finite-differences on fprime are used to compute it.
Newton-CG methods are also called truncated Newton methods. This function differs from scipy.optimize.fmin_tnc because
and scipy while scipy.optimize.fmin_tnc calls a C function.
while scipy.optimize.fmin_tnc is for unconstrained minimization or box constrained minimization. (Box constraints give lower and upper bounds for each variable seperately.)
References
Wright & Nocedal, ‘Numerical Optimization’, 1999, pg. 140.