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
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.