normal_pi {predint}R Documentation

Simple uncalibrated prediction intervals for normal distributed data

Description

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.

Usage

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
)

Arguments

mu

overall mean

pred_se

standard error of the prediction

m

number of future observations

q

quantile used for interval calculation

alternative

either "both", "upper" or "lower" alternative specifies, if a prediction interval or an upper or a lower prediction limit should be computed

futmat_list

used to add the list of future design matrices to the output if called via lmer_pi_futmat()

futvec

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()

newdat

additional argument to specify the current data set

histdat

additional argument to specify the historical data set

algorithm

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

Details

This function returns a simple uncalibrated prediction interval as given in Menssen and Schaarschmidt 2022

[l,u]=μ^±qvar^(μ^)+c=1C+1σ^c2[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 σ^c2\hat{\sigma}^2_c as the c=1,2,...,Cc=1, 2, ..., C variance components and σ^C+12\hat{\sigma}^2_{C+1} as the residual variance and qq 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.

Value

normal_pi() returns an object of class c("predint", "normalPI") with prediction intervals or limits in the first entry ($prediction).

References

Menssen and Schaarschmidt (2022): Prediction intervals for all of M future observations based on linear random effects models. Statistica Neerlandica, doi:10.1111/stan.12260

Examples


# simple PI
norm_pred <- normal_pi(mu=10, pred_se=3, m=1)
summary(norm_pred)


[Package predint version 2.2.1 Index]