[R] R: optim

Thomas Lumley tlumley at u.washington.edu
Thu Sep 8 01:55:14 CEST 2005


On Wed, 7 Sep 2005, Clark Allan wrote:

>
> $MLE$message
> [1] "ERROR: ABNORMAL_TERMINATION_IN_LNSRCH"
>
>
> WHAT DOES THIS ERROR MESSAGE MEAN???
>

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:

>  optim(c(-1.2, 1), fr, function(theta) grr(theta)+1, method = 
"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




More information about the R-help mailing list