Am 02.07.2009 22:03, Klein, Christoph schrieb:
seems like the starting set was already quite optimal. Though gretl
steps to the new point, because the criteria for advancing in line
544 in gretl_bfgs.c is (f >= fmax + d). d is set as d = sumgrad *
steplen * acctol and in my case seems to be negative. The criteria
for printing the error message (line 645) is: (fmax < f0). The
attached patch (one-liner) changes this to ((fmax + d) <= f0). Is
this change ok?
Without really knowing the code context and thus at the risk of babbling
stupid things, shouldn't the case of d<0 then be ruled out? That is,
change the criterion in line 544 to f >= fmax + max(0,d)?
Because otherwise it seems that starting from an optimum the negative
gradient moves you away from the maximum but f >= fmax + d will be true
when d<0 and thus gretl thinks it's going in the right direction.
just a thought,
sven