search for: bootstrapfor

Displaying 1 result from an estimated 1 matches for "bootstrapfor".

2008 May 04
1
Residual resampling for non linear reg model
...tsalpha<-0.05#matrix that's going to contain the bootstrap coefficientsboot.coef<-matrix(NA, B+1, 2)#fit the initial modelinit.values<-c(alpha=20,beta=0)model<-nls(manhours~cases/(alpha+(beta*cases)), start=init.values, trace=TRUE)pred<-predict(model)resid<-resid(model)#do the bootstrapfor (i in 1:B){ #resample the residuals resample.index<-sample(1:n,n,replace=T) resample.mp<-pred+resid[resample.index] #refit the model init.values<-c(alpha=20,beta=0) new.model<-nls(resample.mp~cases/(alpha+(beta*cases)),start=init.values, trace=TRUE) #extract the parameter estimat...