profile.onls: Profiles of the orthogonal-distance objective

View source: R/inference.R

profile.onlsR Documentation

Profiles of the orthogonal-distance objective

Description

Profiles the minimized orthogonal-distance objective of an onls fit for each free parameter, and plots the profiles or turns them into confidence intervals.

Usage

## S3 method for class 'onls'
profile(fitted, which = NULL, maxpts = 100, alphamax = 0.01,
        delta.t = cutoff/5, ...)
## S3 method for class 'profile.onls'
plot(x, absVal = TRUE, level = 0.95, ...)
## S3 method for class 'profile.onls'
confint(object, parm, level = 0.95, ...)

Arguments

fitted

an object returned from onls.

which

parameters to profile, as names or indices; default all free parameters. Fixed parameters are not profiled.

maxpts

maximum number of points in each direction of a profile.

alphamax

the profile is extended in each direction until |\tau| exceeds the 1 - alphamax quantile (see 'Details').

delta.t

step size of the profile on the \tau scale; cutoff is that quantile.

x, object

an object returned from profile.onls.

absVal

logical. If TRUE, |\tau| is plotted, otherwise \tau.

level

confidence level for the reference lines of the plot and for the intervals.

parm

parameters for which intervals are computed, as names or indices.

...

further arguments, passed to plot by the plot method and ignored otherwise.

Details

For parameter \theta_j, the parameter is held fixed at values on both sides of its estimate, and all other free parameters and all foot points are re-optimized by onls (using the data, weights and settings stored in fitted, so that the profile does not depend on objects in the calling environment). With \hat S the minimized objective and S(\theta_j) the constrained minimum, the profile statistic is

\tau(\theta_j) = \mathrm{sign}(\theta_j - \hat\theta_j) \sqrt{\left(S(\theta_j) - \hat S\right)/s^2}

with s^2 = \hat S/\mathrm{df} when the variances are estimated and s^2 = 1 when they are known (known_sigma = TRUE). The grid is extended until |\tau| exceeds \sqrt{F_{1-\alpha}(1, \mathrm{df})} (estimated variances) or \sqrt{\chi^2_{1-\alpha}(1)} (known variances), with \alpha = alphamax, or a failed refit, a flat profile, a lower/upper bound (at which the profile is evaluated last) or maxpts stops it; the reason is stored in the stop element of the "parameters" attribute of each profile. The stepping follows profile.nls. Models with one free parameter are profiled by refits in which only the foot points are optimized. With estimated variances, an exact fit (no residual degrees of freedom) cannot be profiled and gives an error.

confint uses the part of the profile on which \tau increases steadily away from the estimate, interpolates it (a monotone spline of \tau over the parameter, inverted) at \tau = \pm q, with q the normal (known variances) or t quantile; confint.onls with method = "profile" calls it.

Value

profile.onls: a list with one data frame per profiled parameter, with components tau and par.vals (the parameter values along the profile), of class c("profile.onls", "profile"). The attributes "original.fit" and "summary" hold the fit and its summary.

confint.profile.onls: a matrix of lower and upper limits. plot.profile.onls: NULL, invisibly.

Author(s)

Andrej-Nikolai Spiess

See Also

confint.onls.

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))
prof <- profile(mod1)
plot(prof)
confint(prof)

onls documentation built on Nov. 9, 2026, 5:06 p.m.