Hi R users,
Is is possible for me to use the try function with boot? I would to do the bootstraping with a nonlinear model(it works well when R < 1000). But it does not work very well (when R is large) thus I try to use "try" to resolve. I put the try function in two cases:

case1: put the try in front of the boot

c1.try<-try(boot(c1data, statistic = c1.fun, R=3999),silent=T)
c1.try
[1] "Error in nls(formula = density ~ nmf(time, alpha, delta, psi, tau, gamma), : \n Convergence failure: false convergence (8)\n"
attr(,"class")
[1] "try-error"

case2: put the try in front of the nls
 c1.nmf<-try(nls(density~nmf(time, alpha, delta, psi, tau, gamma),
+            algorithm="port",data=c1,
+            lower=c(alpha=0.1, delta=0, psi=0.2, tau=1, gamma=-5),
+            upper=c(alpha=0.6, delta=0.1, psi=3, tau=7, gamma=2),
+ start=c(alpha=0.35, delta=0, psi=0.99, tau=4.5, gamma=-1.2)),silent=T)
c1.try<-boot(c1data, statistic = c1.fun, R=3999)
Error in nls(formula = density ~ nmf(time, alpha, delta, psi, tau, gamma), :
  Convergence failure: iteration limit reached without convergence

Any suggestion will be helpful.
Many thanks in advance
Chunhao

______________________________________________
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.

Reply via email to