Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

int_conformal_split(): Residuals should be sorted? #126

Open
mdancho84 opened this issue Aug 4, 2023 · 3 comments
Open

int_conformal_split(): Residuals should be sorted? #126

mdancho84 opened this issue Aug 4, 2023 · 3 comments

Comments

@mdancho84
Copy link

I checked out int_conformal_split() function. One thing that I did differently was I take the absolute value and sort the residuals in modeltime's implementation. This ensures that the range of residuals are below the selected level.

q_val <- object$resid[q_ind]

Probably Implementation:

image

What I implementing in Modeltime:

image

@brshallo
Copy link

@mdancho84 that seems consistent with what Angelopoulos, Bates do in Gentle Introduction to Conformal Prediction...

image

Same issue looks like it is in predict.int_conformal_quantile():

q_val <- object$resid[q_ind]

@topepo
Copy link
Member

topepo commented Feb 22, 2024

They are "pre-absoluted" and pre-sorted for split inference and only pre-sorted for quantile inference.

For the quantile method, I was working off of Ryan Tibshirani's notes (page 13 section 4.2), which does not use the absolute value (and probably doesn't need to since it operated in a completely different way).

If it helps, I did do a pretty thorough simulation of these functions to check their coverage. Not that there are no errors in the code, but the current version does seem to do what it is intended to do (statistically, at least).

@brshallo
Copy link

They are "pre-absoluted" and pre-sorted for split inference and only pre-sorted for quantile inference.

Ahh, I see now, thanks. (For quantile based method, the Angelopoulos & Bates paper I referenced also just sorts and does not take absolutes -- consistent with your implementation / Tibshirani.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants