This helper function returns a bootstrap calibrated coefficient for the calculation of prediction intervals (and limits).
bisection(
y_star_hat,
pred_se,
y_star,
alternative,
quant_min,
quant_max,
n_bisec,
tol,
alpha,
traceplot = TRUE
)
This function returns \(q^{calib}\) in the equation above.
a list of length \(B\) that contains the expected future observations. Each entry in this list has to be a numeric vector of length \(M\).
a list of length \(B\) that contains the standard errors of the prediction. Each entry in this list has to be a numeric vector of length \(M\).
a list of length \(B\) that contains the future observations. Each entry in this list has to be a numeric vector of length \(M\).
either "both", "upper" or "lower".
alternative
specifies if a prediction interval or
an upper or a lower prediction limit should be computed
lower start value for bisection
upper start value for bisection
maximal number of bisection steps
tolerance for the coverage probability in the bisection
defines the level of confidence (\(1-\alpha\))
if TRUE
: Plot for visualization of the bisection process
This function is an implementation of the bisection algorithm of Menssen
and Schaarschmidt 2022. It returns a calibrated coefficient \(q^{calib}\) for the
calculation of pointwise and simultaneous prediction intervals
$$[l,u] = \hat{y}^*_m \pm q^{calib} \hat{se}(Y_m - y^*_m),$$
lower prediction limits
$$l = \hat{y}^*_m - q^{calib} \hat{se}(Y_m - y^*_m)$$
or upper prediction limits
$$u = \hat{y}^*_m + q^{calib} \hat{se}(Y_m - y^*_m)$$
that cover all of \(m=1, ... , M\) future observations.
In this notation, \(\hat{y}^*_m\) are the expected future observations for each of
the \(m\) future clusters, \(q^{calib}\) is the
calibrated coefficient and \(\hat{se}(Y_m - y^*_m)\)
are the standard errors of the prediction.
Menssen and Schaarschmidt (2022): Prediction intervals for all of M future
observations based on linear random effects models. Statistica Neerlandica.
tools:::Rd_expr_doi("10.1111/stan.12260")