From ripley at stats.ox.ac.uk  Sat Aug 27 19:19:32 2005
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat, 27 Aug 2005 18:19:32 +0100 (BST)
Subject: [Rd] bug in L-BFGS-B? (PR#8099)
In-Reply-To: <x27je7uws7.fsf@turmalin.kubism.ku.dk>
References: <20050827141028.DCE0218B9F@slim.kubism.ku.dk>
	<Pine.LNX.4.61.0508271525290.4656@gannet.stats>
	<x27je7uws7.fsf@turmalin.kubism.ku.dk>
Message-ID: <Pine.LNX.4.61.0508271816110.6706@gannet.stats>

On Sat, 27 Aug 2005, Peter Dalgaard wrote:

> Prof Brian Ripley <ripley at stats.ox.ac.uk> writes:
>
>> Check your versions of MASS.  The Windows one appears to be an outdated
>> version, and does different things.
>
> Forgetting to run tools/rsync-recommended during build will do that
> sort of thing to you, but it would seem that Berwin used a binary
> download. But of course he might be picking up an older version of the
> package from a private library.

I think it is a case of the version released with 2.1.0 vs an update 
(possibly one post 2.1.1).

>> As for the problem, yes it probably is a bug in L-BFGS-B.  Fancy debugging
>> the code?
>
> B. might just be capable of it, but this is certainly some of the more
> impenetrable code in R. While he (or anyone else) is in there, there
> seems to be another problem in that the Hessian calculations refuse to
> stay within the bounds (which is pretty annoying when the objective
> function is undefined outside of them). Try for instance
>
> f <- function(p) sum(ifelse(p>=-1e-4,p,Inf)^2)
> optim(f, lower=c(0,0), par=c(5,5), method="L-BFGS-B")
> optim(f, lower=c(0,0), par=c(5,5), method="L-BFGS-B", hess=T)

I think you will find that is as documented: see the return value stated.
Could be fixed though.



[Rd] bug in L-BFGS-B? (PR#8099)
Prof Brian Ripley