[R] a question on R optimization functions

Dajiang J. Liu dajiang.liu at gmail.com
Fri Mar 25 08:59:20 CET 2011


Dear All,

I use nlminb or optim for maximizing likelihood functions. Sometimes,
the parameter values happen to be NA, then the program will hang there
and iterate forever without stopping. No error message will be
produced. So I can not use error catch method such as "try". Are there
any suggestions how I can circumvent this problem? Maybe I can time a
function, and if the time exceeds a threshold, it will be stopped. I
am not sure if this is feasible in R. As a note, I am running
simulations with thousands of replicates, so there needs to be a
systematic way of doing this. Are there any suggestions on how to do
this? Thank you very much!

Regards,
Dajiang



More information about the R-help mailing list