confint.egf {epigrowthfit} | R Documentation |
Confidence Intervals
Description
Computes confidence intervals on fixed effect coefficients,
random effect covariance parameters, and linear combinations thereof,
including population fitted values.
Intervals on individual fitted values accounting for random effects
are supported, but only by method = "wald"
.
Usage
## S3 method for class 'egf'
confint(object, parm, level = 0.95,
A = seq_along(par), method = c("wald", "profile", "uniroot"), scale = 7,
parallel = egf_parallel(), trace = FALSE,
top = egf_top(object), subset = NULL, select = NULL,
class = FALSE, link = TRUE, random = FALSE, ...)
## S3 method for class 'confint.egf'
plot(x, by = 12L,
subset = NULL, order = NULL, label = NULL, main = NULL, ...)
Arguments
object |
an |
parm |
unused argument, for consistency with the generic function. |
level |
a number in the interval |
A |
a numeric matrix with |
method |
a character string indicating how intervals are computed. |
scale |
a positive number, for |
parallel |
an |
trace |
a logical. If |
top |
a subset of |
subset , select |
index vectors for the rows and columns of
|
class |
a logical. If |
link |
a logical. If |
random |
a logical, affecting only |
... |
additional arguments passed from or to other methods. |
x |
a |
by |
a positive integer indicating the number of intervals displayed in one plot. |
order |
a permutation of |
label |
a character or expression vector of length |
main |
a character or expression vector of length 1 indicating a plot title, to be recycled for all plots. |
Details
Three methods for computing confidence intervals are available:
"wald"
-
confidence limits are calculated as
value + c(-1, 1) * sqrt(q) * se
where
q = qchisq(level, df = 1)
. "profile", "uniroot"
-
confidence limits are calculated as approximate solutions of the equation
2 * (f(x) - f(value)) = q
where
q = qchisq(level, df = 1)
andf
is the negative log marginal likelihood function expressed as a function of the parameterx
in question. Solutions are approximated by interpolating a likelihood profile ("profile"
) or by rootfinding ("uniroot"
).
"wald"
assumes asymptotic normality of the maximum likelihood
estimator. "profile"
and "uniroot"
avoid this contraint
but are typically expensive, requiring estimation of many restricted
models.
They are parallelized at the C++ level when there is OpenMP
support and object[["control"]][["omp_num_threads"]]
is set
to an integer greater than 1. When there is no OpenMP support, they
can still be parallelized at the R level with appropriate setting
of argument parallel
.
Value
A numeric array in 2 or 3 dimensions containing the lower and upper confidence limits in the last dimension.
When confidence intervals on fitted values are desired, the user will
set A = NULL
and in that case have the option of passing
class = TRUE
to obtain an augmented result. Thus, alternatively:
A data frame inheriting from class confint.egf
, with variables:
top |
top level nonlinear model parameter, from
|
ts |
time series, from
|
window |
fitting window, from
|
value |
fitted value. |
ci |
a numeric matrix with two columns giving the lower and upper confidence limits. |
... |
further variables from
model.frame(object, "combined")
specified by argument |
The confidence level level
is preserved as an attribute.
See Also
The generic function confint
.
Examples
example("egf", package = "epigrowthfit")
zz1 <- confint(m1, A = NULL, method = "wald", class = TRUE,
random = TRUE)
str(zz1)
op <- par(mar = c(4.5, 4, 2, 1), oma = c(0, 0, 0, 0))
plot(zz1)
par(op)
zz2 <- confint(m1, A = NULL, method = "profile", class = TRUE,
top = "log(r)", subset = quote(country == "A" & wave == 1))
zz3 <- confint(m1, A = NULL, method = "uniroot", class = TRUE,
top = "log(r)", subset = quote(country == "A" & wave == 1))