Learn R Programming

onls (version 0.1-2)

confint.onls: Confidence intervals for 'onls' model parameters

Description

Computes confidence intervals for one or more parameters of an onls model. As in MASS:::confint.nls, these are based on profile likelihoods, using onls:::profile.onls and onls:::confint.profile.onls.

Usage

# S3 method for onls
confint(object, parm, level = 0.95, ...)

Value

A matrix (or vector) with columns giving lower and upper confidence limits for each parameter. These will be labelled as (1 - level)/2 and 1 - (1 - level)/2 in % (by default 2.5% and 97.5%).

Arguments

object

an object returned from onls.

parm

a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered.

level

the confidence level required.

...

additional argument(s) for methods.

Author

Andrej-Nikolai Spiess, taken and modified from the nls functions.

Details

Profiling the likelihood uses the following strategy:
If \(\theta\) is the parameter to be profiled and \(\delta\) the vector of remaining parameters,
1) compute the log-likelihood of the model \(\mathcal{L}(\theta^{*}, \delta^{*})\) using the converged parameters,
2) compute a lower bound \(\theta^{*} - 0.6 \cdot \sigma(\theta^{*})\) for the lower confidence limit,
3) define a grid of values ranging from \(\theta^{'}\) to \(\theta^{*}\) (e.g., 100 equidistant points),
4) for each grid value \(\theta_i\), compute the profile log-likelihood value \(\mathcal{L}_1(\theta_i)\) by maximizing \(\mathcal{L}(\theta_i, \delta)\) over \(\delta\)-values by fixing \(\theta\) at \(\theta_i\),
5) find the confidence level by interpolation of the profile traces obtained from 4).

Examples

Run this code
# \donttest{
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)
# }

Run the code above in your browser using DataLab