Learn R Programming

nlstools (version 2.1-0)

nlsBoot: Bootstrap resampling

Description

Bootstrap resampling

Usage

nlsBoot (nls, niter = 999)
  # S3 method for nlsBoot
plot (x, type = c("pairs", "boxplot"), 
      mfr = c(ceiling(sqrt(ncol(x$coefboot))), 
      ceiling(sqrt(ncol(x$coefboot)))), 
      ask = FALSE, ...)
  # S3 method for nlsBoot
print (x, ...)
  # S3 method for nlsBoot
summary (object, ...)

Value

nlsBoot returns a list of 5 objects:

coefboot

contains the bootstrap parameter estimates

bootCI

contains the bootstrap medians and the bootstrap 95% confidence intervals

estiboot

contains the means and std. errors of the bootstrap parameter estimates

rse

is the vector of bootstrap residual errors

nls

the object of class 'nls' given in input

Arguments

nls

an object of class 'nls'

niter

number of iterations

x, object

an object of class 'nlsBoot'

type

type of representation (options are "pairs" or "boxplot")

mfr

layout definition (number of rows and columns in the graphics device)

ask

if TRUE, draw plot interactively

...

further arguments passed to or from other methods

Author

Florent Baty, Marie-Laure Delignette-Muller

Details

Non-parametric bootstrapping is used. Mean centered residuals are bootstrapped. By default, 999 resampled data sets are created from which parameter estimates are obtained by fitting the model on each of these data sets. Whenever the fit fails to converge, a flag reports the number of non-convergences. If the fitting procedure fails to converge in more than 50% of the cases, the procedure is interrupted with a flag and no result is given. The function summary returns the bootstrap estimates (mean and std. dev. of the bootstrapped estimates) and the median and 95 percent confidence intervals (50, 2.5, and 97.5 percentiles of the bootstrapped estimates). The bootstrapped estimate distributions can be visualized using the function plot.nlsBoot either by plotting the bootstrapped sample for each pair of parameters or by displaying the boxplot representation of the bootstrapped sample for each parameter. Notice that nlsBoot does not currently handle transformed dependent variables specified in the left side of the nls formula.

References

Bates DM and Watts DG (1988) Nonlinear regression analysis and its applications. Wiley, Chichester, UK.

Huet S, Bouvier A, Poursat M-A, Jolivet E (2003) Statistical tools for nonlinear regression: a practical guide with S-PLUS and R examples. Springer, Berlin, Heidelberg, New York.

Examples

Run this code
formulaExp <- as.formula(VO2 ~ (t <= 5.883) * VO2res + (t > 5.883) * 
                        (VO2res + (VO2peak - VO2res) * 
                        (1 - exp(-(t - 5.883) / mu))))
O2K.nls1 <- nls(formulaExp, start = list(VO2res = 400, VO2peak = 1600, 
                mu = 1), data = O2K)
O2K.boot1 <- nlsBoot(O2K.nls1, niter = 200)
plot(O2K.boot1)
plot(O2K.boot1, type = "boxplot", ask = FALSE)
summary(O2K.boot1)
  

Run the code above in your browser using DataLab