[R] help on nlm (gradient)

Luz Maria Palacios Derflingher palacios at math.ucalgary.ca
Mon Jun 19 07:12:25 CEST 2006


I am having some trouble using nlm in R for windows version 2.2.1. I have 
to minimise a function which includes in its insides the evaluation of 
integrals through the "adapt" function.
In order to make R work less, I calculated the gradient and coded it. I 
made sure that the code and function for the gradient worked.
So I know that the main function (the one to minimise,let's call it 
"func1") yields values when evaluated.
I know that the gradient I coded also works and yields values when 
evaluated (on its own); when I put it all together and use nlm I get the 
following message:

Error in nlm(func1, starting values,  :
         probable coding error in analytic gradient

Any light that can be shed on this would be highly appreciated.
Many thanks

Luz Palacios
PhD Candidate University of Calgary

More information about the R-help mailing list