Next: , Previous: nrm, Up: Scalar optimization


1.15 A conjugate gradient method

— Function File: [x0,v,nev] cg_min ( f,df,args,ctl )

NonLinear Conjugate Gradient method to minimize function f.

Arguments

Returned values

Control Variables

ctl may have length smaller than 4. Default values will be used if ctl is not passed or if nan values are given.

Example:

function r=df( l ) b=[1;0;-1]; r = -( 2*l{1} - 2*b + rand(size(l{1}))); endfunction
function r=ff( l ) b=[1;0;-1]; r = (l{1}-b)' * (l{1}-b); endfunction
ll = { [10; 2; 3] };
ctl(5) = 3;
[x0,v,nev]=cg_min( "ff", "df", ll, ctl )

Comment: In general, BFGS method seems to be better performin in many cases but requires more computation per iteration See also http://en.wikipedia.org/wiki/Nonlinear_conjugate_gradient.

See also: bfgsmin.