confint.onls | R Documentation |
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
.
## S3 method for class 'onls' confint(object, parm, level = 0.95, ...)
object |
an object returned from |
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. |
Profiling the likelihood uses the following strategy:
If θ is the parameter to be profiled and δ the vector of remaining parameters,
1) compute the log-likelihood of the model \mathcal{L}(θ^{*}, δ^{*}) using the converged parameters,
2) compute a lower bound θ^{*} - 0.6 \cdot σ(θ^{*}) for the lower confidence limit,
3) define a grid of values ranging from θ^{'} to θ^{*} (e.g., 100 equidistant points),
4) for each grid value θ_i, compute the profile log-likelihood value \mathcal{L}_1(θ_i) by maximizing \mathcal{L}(θ_i, δ) over δ-values by fixing θ at θ_i,
5) find the confidence level
by interpolation of the profile traces obtained from 4).
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%).
Andrej-Nikolai Spiess, taken and modified from the nls
functions.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.