Single-sided block-weighted conformal prediction interval from conformalizer
Source:R/Conformal_EQR.R
block_weighted_conformal_PI_unilat.RdSingle-sided block-weighted 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).
- block_ids
Vector of block IDs for each test point, of the same length as
Q_pred. The block IDs should be integers between 1 and the number of blocks, and correspond to the order of thedQ_blocksvector.- dQ_blocks
Vector of block-specific conformal corrections to be added to the extreme quantile regression predictions, of the same length as the number of blocks.
- 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), or a vector of the same length asQ_pred(block-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, and the block IDs, as columns (and optionally coverage probability and alpha),
or (only available for compatibility) a single string description of the PI (for single predictions only).