[R] Question about mle function

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Aug 10 23:16:50 CEST 2004

On 10 Aug 2004, Peter Dalgaard wrote:

> "Victoria Landsman" <msvika at mscc.huji.ac.il> writes:
> > Dear all, 
> > I'd like to find the mle esttimates using the mle function  
> > mle(negloglik, start = list(), fixed=list(), method="..."). 
> > I am using the L-BGFS-B method and I don't supply the gradient
> > function. Is there a way to print the gradients found at the solution
> > value?
> No. The "details" slot in an mle object is simply the return value
> from optim(), and that doesn't provide the gradient. Might be an idea
> to change that, though, since the gradient is obviously not zero where
> the box constraints are active.

Not so easy, as optim does not return it and indeed the gradient is not 
known at R level (it is computed in the C code, for L-BFGS-B rather deep 
inside at that).  It may not even have been computed at the final 
solution.  We would need something similar to do_optimHess, or even to 
make use of that code as it does evaluate the gradient at the solution.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list