Single-sided conformal prediction interval from conformalizer
Source:R/Conformal_EQR.R
conformal_PI_unilat.RdSingle-sided conformal prediction interval from conformalizer
Arguments
- Q_pred
Vector of extreme quantile regression predictions for the test data (same length as the number of test points).
- unilat_conformalizer
Either a conformalizer object obtained from
conformalize_EQR_unilat(), or, directly, the conformal correction to be added to the extreme quantile regression predictions. In the latter case, either a single conformal correction value or a vector of conformal corrections of the same length asQ_predis expected.- return_format
Format of the returned prediction interval. Either 'upper_limit' for a numerical vector of upper PI limits (default), 'interval' for a data frame with columns of lower and upper PI limits, or 'text' for a single string description of the PI (only available for single predictions).
- ymin
Lower endpoint for the response distribution (if known). Can be a single value (marginal lower endpoint) or a vector of the same length as
Q_pred(conditional lower endpoint). Default is-Inf.- coverage_proba, coverage_alpha
(Optional) Marginal coverage probability (or level alpha) for the conformal prediction interval. Only one of
coverage_probaorcoverage_alphamust be provided, ascoverage_alpha = 1 - coverage_proba. Only used for certainreturn_formatoptions.
Value
Depending on the return_format argument, either a numerical vector of upper prediction interval (PI) limits,
a data frame with lower and upper PI limits as columns (and optionally coverage probability and alpha),
or a single string description of the PI (for single predictions only).
Examples
conformal_PI_unilat(Q_pred=c(10,12), unilat_conformalizer=0.3, return_format='upper_limit')
#> [1] 10.3 12.3