Hi R users
Is there any example for nonlinear parametric boot? I google it but I can't find it. I am interested in the parameter estimators of a nonlinear model. But I really don't know how to code it in the "ran.gen" statement (data set from ?nls)

fm1 <- nls(weight ~ Asym/(1+exp((xmid-Time)/scal)), data = ChickWeight,
+        start=c(Asym=337, xmid=16, scal=8))

fm1.fun<-function(data){coef(update(fm1,data=data))}

ran.sim<-function(data,mle){out<-rnorm(n=nrow(data,mle));out}

fm1.boot<-boot(ChickWeight, statistic = fm1.fun, R=99, sim="parametric",
+                ran.gen=ran.sim, mle=coef(fm1))
Error in nrow(data, mle) :
  unused argument(s) (c(337.605336871528, 16.0688379710354, 8.00747460385483))


Any suggestion would be very 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