Bootstraping for generalized nonlinear models and nonlinear mixed models
Bootstraping tools for nonlinear models using a consistent interface
boot_nlme(object, f = NULL, R = 999, psim = 1, cores = 1L, ...)
object |
|
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 |
cores |
number of cores to use for parallel computation |
... |
additional arguments to be passed to function |
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.
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")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.