Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

boot_nlme

Bootstraping for generalized nonlinear models and nonlinear mixed models


Description

Bootstraping tools for nonlinear models using a consistent interface

Usage

boot_nlme(object, f = NULL, R = 999, psim = 1, cores = 1L, ...)

Arguments

object

object of class nlme or gnls

f

function to be applied (and bootstrapped), default coef (gnls) or fixef (nlme)

R

number of bootstrap samples, default 999

psim

simulation level for vector of fixed parameters either for simulate_gnls or simulate_nlme_one

cores

number of cores to use for parallel computation

...

additional arguments to be passed to function boot

Details

This function is inspired by Boot, which does not seem to work with 'gnls' or 'nlme' objects. This function makes multiple copies of the original data, so it can be very hungry in terms of memory use, but I do not believe this to be a big problem given the models we typically fit.

Examples

require(car)
require(nlme)
data(barley, package = "nlraa")
barley2 <- subset(barley, year < 1974)
fit.lp.gnls2 <- gnls(yield ~ SSlinp(NF, a, b, xs), data = barley2)
barley2$year.f <- as.factor(barley2$year)
cfs <- coef(fit.lp.gnls2)
fit.lp.gnls3 <- update(fit.lp.gnls2, 
                      params = list(a + b + xs ~ year.f),
                      start = c(cfs[1], 0, 0, 0, 
                                cfs[2], 0, 0, 0,
                                cfs[3], 0, 0, 0))
## This will take a few seconds                               
fit.lp.gnls.Bt3 <- boot_nlme(fit.lp.gnls3, R = 300) 
confint(fit.lp.gnls.Bt3, type = "perc")

nlraa

Nonlinear Regression for Agricultural Applications

v0.89
GPL-3
Authors
Fernando Miguez [aut, cre] (<https://orcid.org/0000-0002-4627-8329>), José Pinheiro [ctb, cph] (author of nlme::nlsList, nlme::predict.gnls, nlme::predict.nlme), Douglas Bates [ctb, cph] (author of nlme::nlsList, nlme::predict.gnls, nlme::predict.nlme), R-core [ctb, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.