# How to compute a confidence interval on the regression error?

I have a regression model (not necessarily linear regression) and a test set. I would like to be able to say: "If you use my model, then with probability 95%, the prediction error will be in the interval [a,b]" where the prediction error is the difference between predicted y and the real y as given by the test data.

Is there any method to estimate the values a and b from the test set?

I know that using bootstrapping I can calculate confidence interval on the predicted value in a given point x. But I need a confidence interval on the error, independently of x.

• It is common that you can not get what you want. Generally, the CI based on the regression is the function of $x$. – user158565 Jun 21 '19 at 2:51
• Why I can get it for classification but not for regression? – aburkov Jun 21 '19 at 3:02
• Why not just compute the appropriate quantiles of the test errors? – Demetri Pananos Jun 21 '19 at 3:50