[R] bootstrap and nls

Patrick Giraudoux patrick.giraudoux at univ-fcomte.fr
Sun Jul 18 09:13:23 CEST 2004


Hi,

I am trying to bootstrap the difference between each parameters among two non linear regression (distributed loss model) as
following:

# data.frame
> Raies[1:10,]
   Tps  SolA  Solb
1    0 32.97 35.92
2    0 32.01 31.35
3    1 21.73 22.03
4    1 23.73 18.53
5    2 19.68 18.28
6    2 18.56 16.79
7    3 18.79 15.61
8    3 17.60 13.43
9    4 14.83 12.76
10   4 17.33 14.91
etc...

# non linear model (work well)

RaiesLossA.nls<-nls(SolA~a/(1+b*Tps)^c,start=c(a=32,b=0.5,c=0.6))
RaiesLossB.nls<-nls(Solb~a/(1+b*Tps)^c,start=c(a=33,b=1.5,c=0.5))


# bootstrap
library(boot)

dif.param<-function(data,i){
RaiesLossA.nls<-nls(SolA[i]~a/(1+b*Tps[i])^c,start=c(a=31,b=0.5,c=0.6))
RaiesLossB.nls<-nls(Solb[i]~a/(1+b*Tps[i])^c,start=c(a=33,b=1.4,c=0.5))
RaiesLossA.nls$m$getPars()-RaiesLossB.nls$m$getPars()
}

>  myboot<-boot(Raies,dif.param,R=1000)

Error in numericDeriv(form[[3]], names(ind), env) :
        Missing value or an Infinity produced when evaluating the model

It seems that the init values (start=) may come not to be suitable while bootstraping. Data can be sent offline to whom wanted to
try on the dataset.

Any hint welcome!

Best regards,

Patrick Giraudoux


University of Franche-Comté
Department of Environmental Biology
EA3184 af. INRA
F-25030 Besançon Cedex

tel.: +33 381 665 745
fax.: +33 381 665 797
http://lbe.univ-fcomte.fr




More information about the R-help mailing list