0

I would like to constrain the time of estimation to be performed in R. For example, I would like to stop running estimation of a GARCH model (by function ugarchfit from package rugarch) after 10 seconds if it has not finished by that time. This is just one example, and I would be interested in a general way to instruct R to stop whatever function which has been running as long as a chosen time limit. Thank you!

Rich Scriven
  • 97,041
  • 11
  • 181
  • 245
Richard Hardy
  • 375
  • 6
  • 20
  • 2
    http://stackoverflow.com/questions/14552128/run-a-function-for-specified-time-in-r might help. And also http://stackoverflow.com/questions/10952724/how-do-i-time-out-a-lapply-when-a-list-item-fails-or-takes-too-long/10953354#10953354 – Rich Scriven Aug 24 '14 at 19:18
  • Solution under the second link worked well! Thanks! – Richard Hardy Aug 25 '14 at 18:46
  • Does this answer your question? [run a function for specified time in R](https://stackoverflow.com/questions/14552128/run-a-function-for-specified-time-in-r) – Michael Roswell Mar 24 '23 at 15:10

0 Answers0