Skip to content
Prev 76840 / 398502 Next

R: optim

On Wed, 7 Sep 2005, Clark Allan wrote:

            
Looking at the code in optim() a little, it looks as though this error 
comes when the optimiser tries to do a line search in the steepest descent 
direction and finds that the derivative along this line is positive, which 
is impossible.

I have seen this when the gradient is wrong, and I suppose it could also 
happen with numerical gradients when the surface is nearly flat or the 
problem is very badly scaled.

Eg, using the functions in example(optim) and making the gradient wrong:
"L-BFGS-B")
$par
[1] 0.25034245 0.05769649

$value
[1] 0.5644614

$counts
function gradient
       96       96

$convergence
[1] 52

$message
[1] "ERROR: ABNORMAL_TERMINATION_IN_LNSRCH"


 	-thomas