normal_pi()
is a helper function that is internally called by the lmer_pi_...()
functions.
It calculates simple uncalibrated prediction intervals for normal distributed
observations.
normal_pi(
mu,
pred_se,
m = 1,
q = qnorm(1 - 0.05/2),
alternative = "both",
futmat_list = NULL,
futvec = NULL,
newdat = NULL,
histdat = NULL,
algorithm = NULL
)
normal_pi()
returns an object of class c("predint", "normalPI")
with prediction intervals or limits in the first entry ($prediction
).
overall mean
standard error of the prediction
number of future observations
quantile used for interval calculation
either "both", "upper" or "lower"
alternative
specifies, if a prediction interval or
an upper or a lower prediction limit should be computed
used to add the list of future design matrices to the output
if called via lmer_pi_futmat()
used to add the vector of the historical row numbers that define
the future experimental design to the output if called via lmer_pi_futmat()
additional argument to specify the current data set
additional argument to specify the historical data set
used to define the algorithm for calibration if called via
lmer_pi_...()
. This argument is not of interest for the calculation
of simple uncalibrated intervals
This function returns a simple uncalibrated prediction interval as given in Menssen and Schaarschmidt 2022 $$[l,u] = \hat{\mu} \pm q \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 and \(q\) as the quantile used for interval calculation.
The direct application of this uncalibrated prediction interval to real life data
is not recommended. Please use the lmer_pi_...()
functions for real life applications.
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")
# simple PI
norm_pred <- normal_pi(mu=10, pred_se=3, m=1)
summary(norm_pred)
Run the code above in your browser using DataLab