Skip to contents

The book's own non-conformity score, quoted from p. 514: s(x, y) = max{yhat_t^{alpha/2} - y, y - yhat_t^{1-(alpha/2)}}. The conformal quantile of the calibration scores is added to both ends of the test interval, using the finite-sample rank ceil((n+1)(1-alpha)) that delivers the coverage guarantee. The method is Romano, Y., Patterson, E. and Candes, E. (2019), Conformalized Quantile Regression, NeurIPS 32 (arXiv:1905.03222), the book's Reference 11.

Usage

morie_cqr(callo, calhi, caly, lo, hi, alpha = 0.1)

Arguments

callo, calhi

calibration interval endpoints

caly

calibration observations

lo, hi

test interval endpoints to conformalize

alpha

nominal miscoverage

Value

list(qhat, lower, upper, k, n, meanwidth, widening)

Examples

morie_cqr(callo = c(1, 2, 3, 4, 5, 6, 7, 8), calhi = c(1, 2, 3, 4, 5, 6, 7, 8),
  caly = c(1, 2, 3, 4, 5, 6, 7, 8), lo = c(1, 2, 3, 4, 5, 6, 7, 8),
  hi = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $qhat
#> [1] Inf
#> 
#> $lower
#> [1] -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf
#> 
#> $upper
#> [1] Inf Inf Inf Inf Inf Inf Inf Inf
#> 
#> $k
#> [1] 9
#> 
#> $n
#> [1] 8
#> 
#> $meanwidth
#> [1] Inf
#> 
#> $widening
#> [1] Inf
#>