| profile.onls | R Documentation |
Profiles the minimized orthogonal-distance objective of an onls fit for each free parameter, and plots the profiles or turns them into confidence intervals.
## 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, ...)
fitted |
an object returned from |
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 |
delta.t |
step size of the profile on the |
x, object |
an object returned from |
absVal |
logical. If |
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 |
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.
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.
Andrej-Nikolai Spiess
confint.onls.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.