# Linear Regression Prediction Interval for precise y values

When calculating the prediction intervals for a regression function, can the y values be precise values "without errors"?

As far as I know, in regression function calculation only the x values are assumed to have no error and not the y values (see requirements below). But in computational chemistry the calculated values are precise per definition, as same input gives same output, so they don't have standard deviation or sth like that.

The mathematical requirements are, according to my literature (german DIN):

• independent and normally distributed values
• homogeneity between lowest and highest value's variance
• a linear functional relationship where the x values count as errorless and the y values are assumed to have errors

They state: If those requirements are not satisfied, then the calculation scheme cannot be used and another scheme has to be chosen. And that last requirement is, what the question is about: What if both, x and y values, have "no error" ... is the system still usable or do I need something more appropriate?

For clarification, this is the system that should be treated:

$\hskip3.5cm$

• If the relationship between $x$ and $y$ is linear, i.e. $y=\alpha x + \beta$, and there are 'no errors' then you just have to take out two different points $(x_1, y_1)$ and $(x_2, y_2)$ and solve the system of equations $y_1=\alpha x_1 + \beta$ and $y_2=\alpha x_2 + \beta$ for $\alpha$ and $\beta$. – user83346 Aug 25 '15 at 10:56
• If there's no error, then why would you need regression at all? You can simply compute E(Y|x) by observing a single Y for any x you want. (Even better, if the model is correct, you only need to observe as many Y-values as you have unspecified parameters in the model to compute the population values exactly.) – Glen_b Aug 25 '15 at 11:51
• A toy example & a clear statement of your goals might help to clarify what you're trying to do here. As @fcoppens points out, if you know the functional form of the relationship between $x$ & $y$ (which needn't necessarily be linear), estimation of the parameters is straightforward & prediction intervals are of zero width. It sounds rather as if interpolation between the calculated values might be what you're after - statistical models for this sort of problem have narrow prediction intervals for $y$ when $x$ is close to some calculated value & wide ones when $x$ is far away from any. – Scortchi - Reinstate Monica Aug 25 '15 at 11:56
• I edited some more information into the question ... hope that helps in understanding it. – pH13 - Yet another Philipp Aug 25 '15 at 12:22
• So presumably, given a measured value $x$, there would be some variability in the calculated values $y$, which might be modelled as random "error"? That's a least a rather empirical way of approaching it. Another is, supposing you have a particular mechanism for the data-generating process in mind, to consider the errors as being in $x$: see Is regression of x on y clearly better than y on x in this case? (I'm imagining there are some physical parameters that on ... – Scortchi - Reinstate Monica Aug 25 '15 at 14:44

First of all, deterministic (i.e. the same computation always yields the same result) does not imply error-free (not even free of random error!).

That being said, both ways of modeling, $y = f (x)$ as well as $x = f (y)$ are used in chemometrics. The former is known as ordinary or classical regression or calibration, the latter is referred to as inverse calibration.

Both ways of calibration have different characteristics.

• As the comments already pointed out, one important difference is in the assumption where most of the variance is: on $x$ or on $y$.
• In addition, if the purpose of the model is prediction, you should predict forwards, i.e. in the direction that is modeled. That is, if you want to predict experimental results, model $experiment = f (theory)$.
• On the other hand, if you assume the error is on your theoretical model and you are interested in the relationship between theoretical model and experimental results (remember: experimental science makes the fundamental point that if experiment and theory do not agree, it is theory that needs to change) and you e.g. need to measure the slope between experiment and theory, then model $theory = f (experiment)$
• (In chemical analysis as in measuring concentrations, there are more important characteristics, wrt. to how multivariate measurements are used, and whether all constituents of the system are known - but these are probably not relevant for your problem).

I work with vibrational spectra which are sometimes computed for molecules in vacuum and then a correction factor is applied to account for the difference between vacuum (theory) and solution (reality/experiment). While I may be biased because I'm experimental spectroscopist, I'd say that at least in this situation it is very clear where the major source of error is...

About the DIN: are you referring to DIN 32465 or 38402?

They give formulas that are valid only under the stated assumptions (which are also in chemical analysis very often not met, particularly the variance homogeneity (also your graph looks like increasing variance with increasing values). The consequence is that you cannot use the "shortcut" formulas but have to do the proper calculation. In particular, you'd underestimate the uncertainty for high values and overestimate uncertainty for low values. From a statistics point of view, a weighted regression would be appropriate.

However, partiularly if you need to measure figures of merit such as limit of detection LOD or limit of quantitation LOQ, there are straightforward (though tedious) methods to do this almost without assumptions.