This is a followup to this thread: viewtopic.php?f=21&t=1807
I have solved the vast majority of my convergence issues by fixing/not fixing certain parameters, and by setting initial parameter values. However, there are still a few rare known parameter combinations that lead to rare instances of convergence failures. I am hoping to sensor the error message so that my simulation loops do not crash.
So far, I have tried both the 'try' and tryCatch' commands in hopes that I could identify this convergence failure as a 'try-error', and then return this as a 'NA' value in my output matrix. However, I do not think that these commands are recognizing the error message from RMark, and I continue to get the same error message as in the previous thread when using these commands, as opposed to returning a 'try-error' to keep the loop alive. I have used these commands as such:
> w<-try(mark(BARKER.ch,model="Barker",delete=TRUE,model.parameters=list(r=r.0,p=p.0)),TRUE)
Error in if (x4 > x2) { : argument is of length zero
********Following model failed to run : S(~1)p(~1)r(~1)R(~1)R'(~1)F(~1)F'(~1) **********
OR
> w<-tryCatch(mark(BARKER.ch,model="Barker",delete=TRUE,model.parameters=list(r=r.0,p=p.0)),error=function() next)
Error in if (x4 > x2) { : argument is of length zero
********Following model failed to run : S(~1)p(~1)r(~1)R(~1)R'(~1)F(~1)F'(~1) **********
Has anyone had success in silencing these errors? I have also tried setting SILENT=T in the RMark function, but still return this:
"********Following model failed to run : S(~1)p(~1)r(~1)R(~1)R'(~1)F(~1)F'(~1) **********"
Which still crashes the loop
Andrew