[R] Bootstrapping gnls models
Christoph.Scherber at agr.uni-goettingen.de
Fri Nov 7 17:35:33 CET 2008
Here comes a reproducible example, with the original data added.
The error message when running boot() is:
Error in gnls(response.variable ~ a * LD/(b + LD), params <- list(a + :
Step halving factor reduced below minimum in NLS step
boot() in this case only seems to work for very small values of R (say, within [1..5]), which is of
course not desirable. Maybe this is due to problems with model convergence.
I would very much appreciate any help.
model=gnls(model = response.variable ~ a * LD/(b + LD), data = a,
params = list(a + b ~ L), start = c(1, 1, 1, 1))
as.numeric(predict(gnls(response.variable ~ a * LD/(b + LD),
params <- list(a + b ~ L), start = coef(model), data=df)))
Prof Brian Ripley schrieb:
> On Fri, 7 Nov 2008, Christoph Scherber wrote:
>> Dear all,
>> I am trying to bootstrap predictions from gnls models using the
>> following code:
>> # a is the dataframe with which I am working; it contains the variables
>> # response.variable,LD,L,G,P and F
> And without it your code is not reproducible.
>> model=gnls(response.variable ~ a * LD/(b + LD),
>> params = list(a + b ~ L), start = c(1,1,1,1), data=a)
>> as.numeric(predict(gnls(response.variable ~ a * LD/(b + LD),
>> params = list(a + b ~ L), start = coef(model), data=df)))
> Do please try to make your code readable, using spaces and <- for
> assignments. I would have spotted the problem much sooner with legible,
> reproducible code.
>> The problem is that this code yields "NA" for the s.e. of the
>> bootstrap statistics:
>> Bootstrap Statistics :
>> original bias std. error
>> t1* 0.1651658 -0.020663364 NA
>> t2* 0.1669592 -0.021759335 NA
>> t3* 0.1676765 -0.001858686 NA
>> t4* 0.1726982 -0.025321349 NA
>> t5* 0.1658092 0.024721214 NA
>> And hence the boot.ci function and others don?t work.
>> Does anyone have an idea on that?
> Yes: how can you estimate standard errors from a single sample (you set
>> Many thanks and best wishes
>> Dr. rer.nat. Christoph Scherber
>> University of Goettingen
>> DNPW, Agroecology
>> Waldweg 26
>> D-37073 Goettingen
>> phone +49 (0)551 39 8807
>> fax +49 (0)551 39 8806
>> Homepage http://www.gwdg.de/~cscherb1
>> R-help at r-project.org mailing list
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help