This function returns bootstrap-calibrated prediction intervals as well as
lower or upper prediction limits.
If algorithm
is set to "MS22", both limits of the prediction interval
are calibrated simultaneously using the algorithm described in Menssen and
Schaarschmidt (2022), section 3.2.4. The calibrated prediction interval is given
as
$$[l,u] = \hat{\mu} \pm q^{calib} \sqrt{\widehat{var}(\hat{\mu}) + \sum_{c=1}^{C+1}
\hat{\sigma}^2_c}$$
with \(\hat{\mu}\) as the expected future observation (historical mean) and
\(\hat{\sigma}^2_c\) as the \(c=1, 2, ..., C\) variance components and \(\hat{\sigma}^2_{C+1}\)
as the residual variance obtained from the random
effects model fitted with lme4::lmer()
and \(q^{calib}\) as the as the bootstrap-calibrated
coefficient used for interval calculation.
If algorithm
is set to "MS22mod", both limits of the prediction interval
are calibrated independently from each other. The resulting prediction interval
is given by
$$[l,u] = \Big[\hat{\mu} - q^{calib}_l \sqrt{\widehat{var}(\hat{\mu}) + \sum_{c=1}^{C+1} \hat{\sigma}^2_c}, \quad
\hat{\mu} + q^{calib}_u \sqrt{\widehat{var}(\hat{\mu}) + \sum_{c=1}^{C+1} \hat{\sigma}^2_c} \Big].$$
Please note, that this modification does not affect the calibration procedure, if only
prediction limits are of interest.
This function is an direct implementation of the PI given in Menssen and Schaarschmidt
2022 section 3.2.4.