Help parametric boot
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