Yes, you could use try(). Roughly:
boot.nLS <- bootstrap(DATA, {
result <- try(coef(eval(nLS.Object$call)))
if(it was an error)
rep(NA, the right length for a coef vector)
else
result
})
Tim Hesterberg
>Dear all,
>
>I didn't find an useful answer neither in the handbooks nor in the
>archive. The Problem I have is the following: How can I force the
>function "bootstrap" to calculate the statistic for ALL B resamples
>even if a given bootstrap sample doesn't provide successfully a solution
>by using nls()?
>
>nLS.Object <- nls(...., data = DATA, start = list( .... ))
>was successfully calculated.
>boot.nLS <- bootstrap(DATA, coef(eval(nLS.Object$call)), B=1000)
>stops after a few bootstrap samples.
>
>Is there something like try( .... ) which can be used in this
>situation?
>
>
>Dr. Pierre Ilouga
>Screening Operations/Discovery Informatics
>EVOTEC AG
>Schnackenburgallee 114
>22525 Hamburg
>Germany
>
>
>S-PLUS : Copyright (c) 1988, 2002 Insightful Corp.
>S : Copyright Lucent Technologies, Inc.
>Version 6.1.2 Release 2 for Linux 2.2.12 : 2002
>
>S-PLUS : Copyright (c) 1988, 2007 Insightful Corp.
>S : Copyright Insightful Corp.
>Version 8.0.4 for Linux 2.4.21-37.EL, 64-bit : 2007
>
>
>Evotec AG Hamburg. Amtsgericht Hamburg HRB 68223
>Vorstand: Dr. Klaus Maleck und Dr. Mario Polywka
>Aufsichtsratsvorsitzender: Dr. Flemming Ornskov
|