# Estimate the support (~ confidence interval of the output) for a linear regression

Consider a linear regression model like this:

I want to draw two margins, say upper- and lower-bounds, which contains 95% of the data.

Formally, given a regression model ($$\hat{y} = Ax+B$$), I want to find the margin with $$\epsilon$$ length from each side of the regression line such that the absolute error of the model is less than a certain amount for 95% of the training data. In other words:

$$| Ax_i+B - yi| < \epsilon$$ for 95% of the $$x_i$$ values.

What is the proper term for this? How can I estimate it?

PS. The literature I found so far is mostly about the confidence intervals of the oracle values for slope and the base ("A" and "B"), but that's not what I am looking for.

PS. I am using Bayesian linear regression, but I guess the answer is oblivious to whether one uses Bayesian or ordinary linear regression.

• It's unclear what you might be looking for. If you want the bands to include 95% of the data, that's a simple algorithm. But if you want them to include 95% of the underlying distribution, that's a statistical question answered by some form of a tolerance interval. – whuber Jan 6 at 18:10
• @whuber Perfecto. tolerance interval is what I was looking for. Perhaps we can say that the k% tolerance interval is an estimation of the k% margin for future / test data, right? – Ali Jan 6 at 18:19
• That would be a prediction interval. It tends to be comparable in size to a tolerance interval, but the concept differs because future data are random and you have to account for that. – whuber Jan 6 at 18:28