[R] optimization and gradient

Ardia David david.ardia at unifr.ch
Tue Apr 22 11:50:58 CEST 2008


Dear all,
I am using the functions 'optim' and 'nlminb'. For both, you can provide 
a function which computes the gradient of the objective function (to 
enhance speed and precision). In my case, both the objective function 
and the gradient take time to be computed and share many common 
computations (similar matrix, products, etc...). Therefore, I have to 
compute these quantities twice which slows down the procedure. How can I 
get rid of that in a similar way as with 'nlmin' which allows the 
attribute 'gradient' in the output of the objective function?
Thanks a lot for your answer
-- 
David Ardia
H-building, room 11-26
Econometric Institute
Erasmus University
PO Box 1738
NL 3000 DR Rotterdam
The Netherlands
Phone: +31 (0)10 408 2269



More information about the R-help mailing list