Computes confidence intervals for selected parameters from a fitted INAD model. For the fixed effect case, Wald intervals for time varying alpha and theta are computed via Louis identity for supported thinning-innovation combinations. For block effects tau, profile likelihood intervals are computed by fixing one component of tau and re maximizing the log likelihood over nuisance parameters. For negative binomial innovations, Wald intervals for the innovation size parameter are computed using a one dimensional observed information approximation per time point, holding other parameters fixed at their fitted values.
Usage
ci_inad(
y,
fit,
blocks = NULL,
level = 0.95,
idx_time = NULL,
ridge = 0,
profile_maxeval = 2500,
profile_xtol_rel = 1e-06
)Arguments
- y
Integer matrix with
n_subjectsrows andn_timecolumns.- fit
A fitted model object returned by
fit_inad.- blocks
Optional integer vector of length
n_subjects. Required for block effect intervals. If provided, should matchfit$settings$blocks.- level
Confidence level between 0 and 1.
- idx_time
Optional integer vector of time indices for which to compute intervals. Default is all time points.
- ridge
Nonnegative ridge value added to the observed information matrix used for Louis based Wald intervals.
- profile_maxeval
Maximum number of function evaluations used in the profile likelihood refits.
- profile_xtol_rel
Relative tolerance used in the profile likelihood refits.
Value
An object of class inad_ci, a list with elements
settings, level, alpha, theta, nb_inno_size,
and tau. Each non NULL interval element is a data frame with columns
param, est, lower, upper, and possibly se
and width.
Examples
if (FALSE) { # \dontrun{
fit <- fit_inad(y, order = 1, thinning = "nbinom", innovation = "bell", blocks = blocks)
ci <- ci_inad(y, fit, blocks = blocks)
ci$alpha
ci$theta
ci$tau
} # }