confint.onls: Bootstrapped confidence intervals for 'onls' model parameters

View source: R/S3_functions.R

confint.onlsR Documentation

Bootstrapped confidence intervals for 'onls' model parameters

Description

Computes bootstrap confidence intervals for all parameters of an onls model. Confidence limits are obtained from the empirical distribution of parameter estimates generated by nonparametric case-resampling. Unlike confint.nls, which uses profile likelihoods, confint.onls is based on repeated refitting of the orthogonal nonlinear least-squares model to bootstrap samples and therefore remains fully consistent with the estimation criterion used by onls.

Usage

## S3 method for class 'onls'
confint(object, parm, level = 0.95, k = 200, ...)

Arguments

object

an object returned from onls.

parm

just for S3 purposes, as all parameters are bootstrapped.

level

the confidence level required.

k

the number of bootstrap samples.

...

additional argument(s) passed to update.onls.

Details

Confidence intervals are obtained by nonparametric bootstrap resampling.
Let \hat{\theta} denote the vector of parameter estimates from the original fit. For each bootstrap replicate,

  1. rows of the original data set are sampled with replacement to generate a bootstrap sample of the same size as the original data

  2. the model is refitted to the bootstrap sample using onls

  3. parameter estimates from successful fits are stored

  4. After k successful bootstrap fits have been collected, the confidence interval for each parameter is obtained from the empirical quantiles of its bootstrap distribution

Fits that fail to converge or violate internal orthogonality checks are discarded. Additionally, bootstrap estimates whose absolute deviation from the original estimate exceeds twenty times the corresponding estimated standard error are treated as pathological solutions and excluded.

Value

A matrix (or vector) with columns giving lower and upper confidence limits for each parameter.

Author(s)

Andrej-Nikolai Spiess

Examples


set.seed(123)
DNase1 <- subset(DNase, Run == 1)
DNase1$density <- sapply(DNase1$density, function(x) rnorm(1, x, 0.1 * x))
mod1 <- onls(density ~ Asym/(1 + exp((xmid - log(conc))/scal)), 
             data = DNase1, start = list(Asym = 3, xmid = 0, scal = 1))
confint(mod1, k = 100) # just time optimization, consider k >= 200.


onls documentation built on Sept. 21, 2026, 9:06 a.m.