Intervals from the RMSE and Their Use in SPC

Version 8 | Created: 2026-10-09 | Updated: 2026-11-07 13:46 UTC
- 1. Purpose
- 2. Summary
- 3. Taxonomy and its Hierarchy
- 4. RMSE Interval
- 5. Prediction Interval
- 6. Confidence Interval
- 7. Tolerance Interval
- 8. Spec Setting for SPC
- References
- Appendix A. Terminology
- Appendix B. Quantile Functions of the Normal and t Distributions
- Appendix C. Chi-squared Distribution
- Appendix D. Derivation of Equations (4) to (8)
- Problem Statement: The RMSE, a common ML metric, is hard to read as a physical quantity.
- Goal: A guide, in theory and in practice, to setting the limits used alongside a spec in SPC (the error limit and the guard band) from the RMSE of a model.
- Non-Goal: Intervals for errors that are not normally distributed.
This document separates the four intervals drawn around a prediction from the RMSE (the RMSE interval, the prediction interval, the confidence interval and the tolerance interval) by what they cover and the multiplier they use, and applies them to the three SPC limits (the error limit, the guard band and the control limit).
An interval of plus or minus 1.96 standard deviations holds a new error with probability 95.00% when the true standard deviation of the errors is used, and with less when the RMSE of n errors takes its place; the probability is 94% at n = 28 (it rounds to 94% for n from 19 to 55). The ratio of a new error to the RMSE follows Student's t distribution with n degrees of freedom, which pulls the probability below 95%.
To hold 95%, the multiplier is the 97.5% point of that t distribution instead of 1.96. It is 2.05 at n = 28 and returns to 1.96 as n grows. The error limit drawn on the model error uses that multiplier, and when a predicted value replaces a measured value in a conformity decision, the decision uses the existing spec narrowed inward by a guard band.
The size of an interval is a multiple of the RMSE, the model error. The two ends of the interval are the center plus and minus the multiplier times the RMSE, and when
INTERVAL around a prediction: center +/- k * scale
|
+-- axis 1: the scale
| sigma the true error scale, known
| RMSE of n errors an estimate, itself random
|
+-- axis 2: the covered quantity
one future error prediction
the mean of the errors confidence
a fraction of the population tolerance
Fig 1. The two axes an interval around a prediction is placed on
The first axis separates a true from an estimated standard deviation of the errors, the value that sets the width. The second axis separates what an interval of that width is taken to cover, moving from one error to the mean of the errors and then to a fraction of the population.
The intervals on the two axes form a hierarchy by the strength of their assumptions, shown in Fig 2 below.
HIERARCHY of the intervals, with what each step down changes
interval scale multiplier coverage of the next error
Normal interval σ, known z(1 - α/2) 1 - α for every n
|
| assumption dropped: σ is known. The RMSE of n errors takes its place.
|
+-- RMSE interval RMSE z(1 - α/2) below 1 - α
| 0.9400 at α = 0.05, n = 28
+-- prediction interval RMSE t(ν, 1 - α/2) 1 - α for every n
|
| requirement added: the covered fraction must hold with a stated confidence
|
+-- tolerance interval RMSE tolerance factor a stated fraction of the
population, held with a
stated confidence
Fig 2. The hierarchy the intervals form, and the assumption each step drops or the requirement it adds
- σ: The true standard deviation of the errors. Known for the normal interval, unknown for the RMSE, prediction and tolerance intervals.
-
RMSE: The estimate of
$\sigma$ from n errors, defined by Eq. (1). - n: The number of errors formed by pairing predicted with measured values, the n of Eq. (1).
-
ν: The degrees of freedom left in the sum of squares of the RMSE. The figure is the case
$\nu = n$ , with no fitted parameters. - multiplier: The number the standard deviation is multiplied by. The two ends of the interval lie that far from the center.
- coverage: The probability that the error of the model's next prediction falls inside the interval. That error did not exist when the RMSE was computed, so it is independent of the n errors behind the RMSE; this document calls it the new error.
-
1 - α: The probability the interval is set to cover.
$\alpha$ is the remainder, and this document uses$\alpha = 0.05$ . -
z: The quantile function (inverse CDF) of the standard normal distribution. It is the inverse of the CDF
$\Phi$ of Eq. (3), so$z = \Phi^{-1}$ , and$z(q)$ is the value with cumulative probability$q$ .$z(1 - \alpha/2)$ leaves$\alpha$ in the two tails together and is 1.96 at$\alpha = 0.05$ . Details are in Appendix B. -
t: The quantile function of Student's t distribution with
$\nu$ degrees of freedom.$t(\nu, q)$ is the value with cumulative probability$q$ , and$t(\nu, 1 - \alpha/2)$ is 2.05 at$\alpha = 0.05$ and$n = 28$ . - tolerance factor: The multiplier set by the fraction of the population to cover, the confidence that guarantees it, and n. With a confidence above 0.5 it exceeds the multiplier of the prediction interval.
- The
$n = 28$ in the figure is the error count at which the probability is exactly 0.9400. Values at other n are in Table 2.
Each step down the hierarchy drops one assumption or adds one requirement. The top knows the standard deviation of the errors, the next estimates it from n errors, and the bottom uses the estimate to guarantee a fraction of the population. Once
Table 1 lists, for each interval, the value it takes on the two axes of Fig 1, namely the standard deviation it uses and what it covers, together with the multiplier and probability those two fix. The interval to use is chosen from this table by the standard deviation at hand and what has to be covered.
Table 1. Intervals around a prediction
| # | Interval | Scale | Multiplier | Covered quantity | Probability |
|---|---|---|---|---|---|
| 1 | Normal interval | One new error | |||
| 2 | RMSE interval | RMSE | One new error | Value of Eq. (7) | |
| 3 | Prediction interval | RMSE | One new error | $1 - \alpha$ | |
| 4 | Confidence interval | Mean of the errors | $1 - \alpha$ | ||
| 5 | Tolerance interval | RMSE | tolerance factor | At least a fraction |
Confidence $\gamma$ |
At
This section gives Eq. (2), which draws the RMSE interval, and Eq. (7), the probability that this interval holds one new error. The unknown
The two ends of the interval are the center plus and minus 1.96 times the RMSE, and the RMSE is the root mean square of n errors.
The error
In Eq. (2),
Two facts let the RMSE stand in for
-
Expected value: With a zero mean,
$\sigma^2 = E[e_i^2]$ , and the quantity under the square root in Eq. (1) is the sample mean of$e_i^2$ , so$E[\mathrm{RMSE}^2] = \sigma^2$ .$\mathrm{RMSE}^2$ is therefore an unbiased estimator of$\sigma^2$ , and since the sample mean converges to$\sigma^2$ as n grows, the RMSE converges to$\sigma$ . -
Finite n: The t distribution of Eq. (6) accounts exactly for how far the RMSE departs from
$\sigma$ at finite n, so Eq. (7) gives the probability without approximation. That includes the RMSE running slightly below$\sigma$ on average, which pulls the probability of the 1.96 interval below 95%; the size of that drop is in sections 4.2 and 4.3.
With
The RMSE varies from one data set to the next, so it cannot simply replace the
Eq. (4) gives the expected value of the RMSE, which is
A new error divided by the RMSE follows Student's t distribution with n degrees of freedom [4].
The
Table 2. Coverage of the RMSE interval by sample count
| # | n | Coverage | Multiplier for 0.95 | |
|---|---|---|---|---|
| 1 | 5 | 0.9515 | 0.8927 | 2.5706 |
| 2 | 10 | 0.9754 | 0.9216 | 2.2281 |
| 3 | 20 | 0.9876 | 0.9359 | 2.0860 |
| 4 | 25 | 0.9901 | 0.9388 | 2.0595 |
| 5 | 28 | 0.9911 | 0.9400 | 2.0484 |
| 6 | 30 | 0.9917 | 0.9407 | 2.0423 |
| 7 | 40 | 0.9938 | 0.9430 | 2.0211 |
| 8 | 50 | 0.9950 | 0.9444 | 2.0086 |
| 9 | 100 | 0.9975 | 0.9472 | 1.9840 |
| 10 | 200 | 0.9988 | 0.9486 | 1.9719 |
| 11 | 1000 | 0.9998 | 0.9497 | 1.9623 |
The coverage column rises toward 95% as n grows but never reaches it. It rounds to 94% for n from 19 to 55, and row 5, at 0.9400, is the closest. Coverage exceeds 94.5% only for n of 56 or more, and 94.9% only for n of 277 or more. Table 2 is the case
Eq. (7) and the multiplier that keeps 95%, plotted against n, are shown in Fig 3 below.
Fig 3. Coverage of the RMSE interval and the multiplier that restores 95 percent
- (a) The probability of Eq. (7) against n. The upper horizontal line is 0.9500, the value with the standard deviation of the errors known, the lower one is 0.9400, and the marked point is n = 28, where the curve meets the lower line.
- (b) The multiplier
$t_n(0.975)$ that keeps 95%, against n. The horizontal line is 1.96, and the curve comes down to it as n grows.
The probability drops for two reasons. One is that the expected RMSE is smaller than
If the RMSE always equaled its expected value
The probability as a function of the standard deviation,
Both parts shrink together as n grows: 0.0059 and 0.0225 at n = 10, 0.0006 and 0.0022 at n = 100.
A statement that pairs 1.96 with 95% is right only approximately, and only for n in the hundreds, as Table 2 shows. A statement that pairs 1.96 with 94% reports the value for an RMSE-estimated standard deviation with n around 30; with
When p parameters are fitted to the data and the RMSE is computed from the residuals, the degrees of freedom drop to
Eq. (8) reduces to Eq. (7) when p is 0. At n = 28 it gives 0.9299 for p = 2 and 0.9111 for p = 5. At n = 100 and p = 5 it gives 0.9409, the same 0.94 from more than three times the data.
- Assumptions: Errors drawn independently from a normal distribution with mean 0 and a common variance. The errors behind the RMSE independent of the new error to be covered. Leverage, the variation of the predicted value itself, left out (section 5.2).
-
Settings: A multiplier fixed at 1.96. With p parameters fitted to the same data,
$\nu = n - p$ degrees of freedom and the probability from Eq. (8). -
Failure conditions: A nonzero mean error makes the RMSE carry bias as well as spread, so the interval is wider than needed and the probability of Eq. (7) no longer fits it. An error variance that changes with the input (heteroscedasticity) leaves one RMSE unable to represent the errors at every input, and the probability drops at inputs with large variance. Correlated errors leave fewer than n degrees of freedom in the sum of squares, so Eq. (7) overstates the probability. Tails heavier than normal make the same multiplier hold less; a Laplace distribution with the same variance puts 93.7% inside
$\pm 1.96\sigma$ . - Where it is used: Bland-Altman limits on the difference between two measurement methods [3].
The prediction interval replaces the multiplier 1.96 of the RMSE interval with one taken from the t distribution, and the next error falls inside it with probability
In Eq. (9),
It uses the same standard deviation as the RMSE interval of section 4 and differs only in the multiplier. The RMSE interval fixes the multiplier at 1.96, which lowers its probability to Eq. (7); the prediction interval uses the
At
The prediction interval in this document is a simplified one without leverage: the multiplier of Eq. (9) and the probability of Eq. (8) assume a new error independent of the residuals behind the RMSE and with variance
- Assumptions: As in section 4.6.
-
Settings: The multiplier
$\sqrt{n/\nu}; t_{\nu}(0.975)$ of Eq. (9), with$\nu = n - p$ degrees of freedom, p being the number of parameters fitted to the same data. The error count n stays separately in the denominator of Eq. (1), the definition of the RMSE, and enters through$\sqrt{n/\nu}$ . -
Failure conditions: As in section 4.6. Under the four conditions of section 4.6 even the multiplier of Eq. (9) does not keep the probability at
$1 - \alpha$ . - Where it is used: Prediction error ranges reported for regression models, error bars on predicted values of process data, and the error limit of section 8.
The confidence interval holds the mean of the errors rather than a single error, and with the same degrees of freedom and standard deviation it is
The interval is
This interval checks whether the model bias is 0. An interval that excludes 0 means the mean error is not 0, and that bias is removed first, as in the first item of section 8.2.
The tolerance interval guarantees, with confidence
In the prediction interval the next error falls inside with probability
It is used when a requirement names both the fraction of the population the interval must cover and the confidence that must guarantee it, as in "at least 99% of the population with 95% confidence". When only the next point matters, the prediction interval is the right one.
The three limits drawn in SPC on predicted values use the prediction interval, the RMSE interval and the normal interval, and the confidence interval checks the model bias before them.
-
Prediction interval: The error limit (section 8.2). The error of the next prediction must be covered with probability
$1 - \alpha$ for every n, so the multiplier of Eq. (9) is used. - RMSE interval: The guard band of the acceptance limit (section 8.3). ISO 14253-1 subtracts from the spec the expanded uncertainty, the standard uncertainty times a fixed factor of 2, which gives the form of an RMSE interval, a fixed multiplier on the RMSE. As with Eq. (7), the probability held by a fixed multiplier drops as n gets small, so for small n the multiplier is raised toward that of the prediction interval.
-
Normal interval: The control limit (section 8.4). Control limits treat the observed standard deviation as known and add and subtract three times it, which is row 1 of Table 1 with a multiplier of 3, that is
$\alpha = 0.0027$ . - Confidence interval: The bias check (first item of section 8.2). Before the RMSE is computed, the interval of section 6 checks whether the mean error is 0.
-
Tolerance interval: Not used. If the spec requires "at least a fraction
$P$ of the population with confidence$\gamma$ ", the multiplier of the error limit becomes the tolerance factor of section 7.
The error limit and the guard band come from the RMSE, and the control limit comes from the process variation. The three limits are compared in Table 3.
Table 3. Limits around a predicted value
| # | Limit | Set from | Offset | What it decides |
|---|---|---|---|---|
| 1 | Error limit | RMSE | Whether to accept the error of one prediction | |
| 2 | Acceptance limit | Spec and RMSE | Whether to decide conformity on a predicted value | |
| 3 | Control limit | Process variation | Three observed standard deviations | Whether the process has changed |
Row 1 is the range within which the model may replace a measurement. Row 2 is the existing spec narrowed inward, and the amount of narrowing is the guard band. Row 3 does not come from the spec, but on a chart of predicted values its width also reflects the RMSE, through Eq. (11).
The error limit, row 1 of Table 3, is Eq. (9) of section 5 with
- Remove the bias first: A nonzero mean error makes the RMSE carry bias as well as spread (section 4.6) and widens the limit beyond what is needed. Correct the bias in the model and recompute the RMSE.
-
Use data not used to fit the model: No parameters were fitted to those data, so
$\nu = n$ . Residuals from the fitting data reduce the degrees of freedom to$\nu = n - p$ and make Eq. (7) overstate the probability, so the probability then comes from Eq. (8) and the multiplier from Eq. (9) with that$\nu$ . - Count the errors first: At n around 30, 1.96 holds 94%, so a 95% error limit takes its multiplier from Table 2 instead.
When a predicted value replaces a measured value in a conformity decision, the decision uses an acceptance limit narrowed inward from the spec.
Only items between the two values of Eq. (10) are accepted, and the width
Control limits come from the process variation and the spec from the requirement, so the two are not set to the same value. On a chart of predicted values the observed variation contains both the process variation and the model error.
The
[1] Meeker, W. Q., Hahn, G. J., & Escobar, L. A. (2017). Statistical Intervals: A Guide for Practitioners and Researchers (2nd ed.). John Wiley & Sons. ISBN 978-0471687177.
[2] NIST/SEMATECH. (2012). e-Handbook of Statistical Methods. NIST Handbook 151, National Institute of Standards and Technology.
[3] Bland, J. M., & Altman, D. G. (1986). Statistical Methods for Assessing Agreement Between Two Methods of Clinical Measurement. The Lancet, 327(8476), 307–310.
[4] Student. (1908). The Probable Error of a Mean. Biometrika, 6(1), 1–25.
[5] JCGM. (2012). Evaluation of Measurement Data — The Role of Measurement Uncertainty in Conformity Assessment. JCGM 106:2012, Joint Committee for Guides in Metrology.
[6] ISO. (2017). Geometrical Product Specifications (GPS) — Inspection by Measurement of Workpieces and Measuring Equipment — Part 1: Decision Rules for Verifying Conformity or Nonconformity with Specifications. ISO 14253-1:2017, International Organization for Standardization.
- chi-squared distribution: The distribution of the sum of squares of independent standard normal values. Defined by Eq. (15).
- concave: The property of a function with a negative second derivative, whose curve bends downward.
- confidence interval: An interval with a set probability of containing the parameter being estimated.
- consumer's risk: The probability that an accepted item is out of spec.
- control limit: The limit on a chart that tells whether the process is behaving as usual. Computed from the process variation.
- coverage: The probability that an interval actually covers what it is meant to cover.
- coverage factor: The number the standard uncertainty is multiplied by to give the expanded uncertainty. Customarily 2.
- degrees of freedom: The number of independent components left in a sum of squares.
- expanded uncertainty: The standard uncertainty times the coverage factor.
- gamma function: The function defined by the integral of Eq. (19). It extends the factorial of positive integers.
- guard band: The width between the spec and the acceptance limit. Defined by Eq. (10).
- heteroscedasticity: An error variance that changes with the input or the process level.
- Jensen's inequality: For a concave function, the function of the expected value is at least the expected value of the function.
- Laplace distribution: A symmetric distribution whose two tails decay exponentially. Its tails are heavier than those of a normal distribution with the same variance.
- leverage: A measure of how far a new input lies from the center of the data. It sets how much the predicted value itself varies.
- lower incomplete gamma function: The gamma function with its integral cut off at a finite upper limit. Defined by Eq. (18).
- Monte Carlo: Estimating a probability from samples generated with random numbers.
- prediction interval: An interval with a set probability of containing one new observation.
- process capability index: The width of the spec divided by six times the process variation.
- producer's risk: The probability that a rejected item is within spec.
-
quantile function: The inverse of a CDF. For a probability
$q$ it gives the value with cumulative probability$q$ . Defined by Eq. (13). - regularized incomplete gamma function: The lower incomplete gamma function divided by the gamma function. It is the right-hand side of Eq. (17).
- RMSE: The square root of the mean of the squared errors. Defined by Eq. (1).
- spec limit: The upper and lower limits that come from the requirement. Set separately from the process variation.
- Student t distribution: The distribution of a standard normal value divided by the square root of an independent chi-squared value over its degrees of freedom.
- tolerance factor: The multiplier on the standard deviation in a tolerance interval. Fixed by the fraction, the confidence level and the sample size.
- tolerance interval: An interval guaranteed, with a stated confidence, to cover a stated fraction of the population.
- unbiased estimator: An estimator whose expected value equals the quantity it estimates.
A CDF gives, for a value
The two ends of an interval that leaves
With
Student's t distribution with
Given
-
$k$ (degrees of freedom): The number of independent standard normal variables summed.
The main text writes the same degrees of freedom as n and
The probability density function of the chi-squared distribution with
The CDF
The CDF of the chi-squared distribution has no simple form in elementary functions. It is therefore written, as in Eq. (17), as a regularized incomplete gamma function, and computed with numerical methods or the statistical functions of R, Python or Excel.
-
Range:
$X \ge 0$ . A sum of squares is never negative. -
Mean:
$E(X) = k$ . -
Variance:
$\mathrm{Var}(X) = 2k$ . -
Shape: Right-skewed with a long right tail for small
$k$ , and closer to a symmetric normal shape as$k$ grows.
The starting point is a single fact: an error divided by
The second equality is Eq. (1) squared and multiplied by n, and it is Eq. (4). Eq. (5) follows from the expected value of the square root. The square root of a chi-squared value with n degrees of freedom has the expected value below.
Eq. (20) gives
Eq. (6) follows from the definition of the t distribution. The new error
With p fitted parameters, the degrees of freedom of the sum of squares drop to
The left-hand side of Eq. (23) is at most 1.96 exactly when
Version 51 | Created: 2026-10-05 | Updated: 2026-11-07 13:46 UTC
- 1. Purpose
- 2. Summary
- 3. Taxonomy and its Hierarchy
- 4. RMSE Interval
- 5. Prediction Interval
- 6. Confidence Interval
- 7. Tolerance Interval
- 8. Spec Setting for SPC
- References
- Appendix A. Terminology
- Appendix B. Quantile Functions of the Normal and t Distributions
- Appendix C. Chi-squared Distribution
- Appendix D. Derivation of Equations (4) to (8)
- Problem Statement: ML 의 metric 인 RMSE 의 물리적 의미를 이해하기 힘들다.
- Goal: model 의 오차인 RMSE 를 이용해 SPC 에서 spec 과 함께 쓸 한계 (error limit 과 guard band) 를 정하는 방법의 이론과 실행을 담은 guide 를 만든다.
- Non-Goal: 오차가 정규분포가 아닐 때 쓸 구간은 다루지 않는다.
이 문서는 RMSE 로 예측값 주위에 긋는 구간 네 가지 (RMSE interval, prediction interval, confidence interval, tolerance interval) 를 담는 대상과 배율로 가르고, 그 구간을 SPC 의 세 한계 (error limit, guard band, control limit) 에 적용한다.
RMSE 의 1.96 배로 그린 구간이 새 오차 하나를 담는 비율은 오차의 참 표준편차를 알 때 95.00% 이고, RMSE 를 오차 n 개에서 구했으면 그보다 낮으며, 94% 가 되는 것은 n 이 28 일 때다 (n 이 19 부터 55 까지면 94% 로 반올림된다). 새 오차를 RMSE 로 나눈 값이 자유도 n 의 Student t distribution 을 따르므로 비율이 95% 아래로 깎인다.
95% 를 지키려면 배율을 1.96 대신 그 t distribution 의 97.5% 점으로 둔다. n 이 28 이면 2.05 이고, n 이 커지면 1.96 으로 돌아간다. Model 의 오차에 긋는 한계 (error limit) 는 그 배율로 긋고, 예측값이 계측값을 대신해 판정에 쓰이면 이미 있는 spec 을 guard band 만큼 안쪽으로 좁혀 판정한다.
구간의 크기는 model 의 오차인 RMSE 의 배율로 구한다. 구간의 두 끝은 중심에 RMSE 의 배율 배를 더하고 뺀 값이며,
INTERVAL around a prediction: center +/- k * scale
|
+-- axis 1: the scale
| sigma the true error scale, known
| RMSE of n errors an estimate, itself random
|
+-- axis 2: the covered quantity
one future error prediction
the mean of the errors confidence
a fraction of the population tolerance
Fig 1. The two axes an interval around a prediction is placed on
첫째 축은 구간의 폭을 정하는 오차의 표준편차가 참값인가 추정값인가를 가른다. 둘째 축은 같은 폭의 구간이 무엇을 담는다고 보는가를 가르며, 담는 대상이 오차 하나에서 오차의 평균으로, 다시 모집단의 비율로 옮겨 간다.
두 축 위의 구간은 가정의 세기에 따라 계층을 이루며, 그 계층은 아래 Fig 2 와 같다.
HIERARCHY of the intervals, with what each step down changes
interval scale multiplier coverage of the next error
Normal interval σ, known z(1 - α/2) 1 - α for every n
|
| assumption dropped: σ is known. The RMSE of n errors takes its place.
|
+-- RMSE interval RMSE z(1 - α/2) below 1 - α
| 0.9400 at α = 0.05, n = 28
+-- prediction interval RMSE t(ν, 1 - α/2) 1 - α for every n
|
| requirement added: the covered fraction must hold with a stated confidence
|
+-- tolerance interval RMSE tolerance factor a stated fraction of the
population, held with a
stated confidence
Fig 2. The hierarchy the intervals form, and the assumption each step drops or the requirement it adds
- σ: 오차의 참 표준편차. Normal interval 은 그 값을 아는 경우이고, RMSE interval 과 prediction interval 과 tolerance interval 은 모르는 경우다.
-
RMSE: 오차 n 개로 구한
$\sigma$ 의 추정값. 식 (1) 이 정의다. - n: Model 의 예측값과 계측값을 짝지어 오차를 구한 횟수. 식 (1) 에서 사용한 n 개다.
-
ν: RMSE 의 제곱합에 남은 자유도. 그림은 parameter 를 추정하지 않아
$\nu = n$ 인 경우다. - multiplier: 표준편차에 곱하는 수. 구간의 두 끝이 중심에서 그만큼 떨어진다.
- coverage: Model 이 다음에 한 번 더 예측했을 때 그 오차가 구간 안에 들 확률. 그 오차는 RMSE 를 구하던 때에는 아직 생기지 않았으므로 RMSE 를 구한 n 개와 독립이고, 이 문서는 이 오차를 새 오차라 부른다.
-
1 - α: 구간이 담을 확률로 정한 값.
$\alpha$ 는 그 나머지이고, 이 문서는$\alpha = 0.05$ 를 쓴다. -
z: 표준정규분포의 분위수 함수 (quantile function, inverse CDF). 식 (3) 의 누적분포함수
$\Phi$ 의 역함수여서$z = \Phi^{-1}$ 이고,$z(q)$ 는 누적확률이$q$ 가 되는 지점이다.$z(1 - \alpha/2)$ 는 양쪽 꼬리에 합쳐$\alpha$ 를 남기며,$\alpha = 0.05$ 에서 1.96 이다. 자세한 내용은 Appendix B 에 있다. -
t: 자유도
$\nu$ 인 Student t distribution 의 분위수 함수.$t(\nu, q)$ 는 누적확률이$q$ 가 되는 지점이고,$t(\nu, 1 - \alpha/2)$ 는$\alpha = 0.05$ 와$n = 28$ 에서 2.05 다. - tolerance factor: 모집단의 어느 비율까지 담을지와 그것을 보장하는 신뢰수준, 그리고 n 으로 정해지는 배율. 신뢰수준을 0.5 보다 높게 두면 prediction interval 의 배율보다 크다.
- 그림의
$n = 28$ 은 담는 확률이 꼭 0.9400 이 되는 오차 개수다. 다른 n 에서 나오는 값은 Table 2 에 있다.
계층을 한 단계 내려갈 때마다 가정을 하나 버리거나 요구를 하나 더한다. 맨 위는 오차의 표준편차를 알고, 그 아래는 표준편차를 n 개의 오차로 추정하며, 맨 아래는 추정한 표준편차로 모집단의 비율까지 보장한다.
Table 1 에는 구간마다 Fig 1 의 두 축에서 고른 값, 곧 쓰는 표준편차와 담는 대상이 있고, 그 둘로 정해지는 배율과 확률도 함께 있다. 쓸 구간은 가진 표준편차와 담아야 하는 대상으로 이 표에서 고른다.
Table 1. Intervals around a prediction
| # | Interval | Scale | Multiplier | Covered quantity | Probability |
|---|---|---|---|---|---|
| 1 | Normal interval | 새 오차 하나 | |||
| 2 | RMSE interval | RMSE | 새 오차 하나 | 식 (7) 의 값 | |
| 3 | Prediction interval | RMSE | 새 오차 하나 | $1 - \alpha$ | |
| 4 | Confidence interval | 오차의 평균 | $1 - \alpha$ | ||
| 5 | Tolerance interval | RMSE | tolerance factor | 모집단의 비율 |
신뢰수준 $\gamma$ |
이 꼭지는 RMSE interval 을 긋는 식 (2) 와, 그 구간이 새 오차 하나를 담는 확률을 구하는 식 (7) 을 다룬다. 식 (7) 을 유도하면 모르는
구간의 두 끝은 중심에 RMSE 의 1.96 배를 더하고 뺀 값이고, RMSE 는 오차 n 개의 제곱평균제곱근이다.
식 (1) 의 오차
식 (2) 의
-
기댓값: 오차의 평균이 0 이므로
$\sigma^2 = E[e_i^2]$ 이고, 식 (1) 의 제곱근 안이 바로$e_i^2$ 의 표본평균이어서$E[\mathrm{RMSE}^2] = \sigma^2$ 이 성립한다. 곧$\mathrm{RMSE}^2$ 은$\sigma^2$ 의 불편추정량 (unbiased estimator) 이고, n 이 커지면 표본평균이$\sigma^2$ 로 모이므로 RMSE 도$\sigma$ 로 모인다. -
유한한 n: RMSE 가
$\sigma$ 와 어긋나는 몫을 식 (6) 의 t distribution 이 그대로 셈에 넣으므로, 담는 확률을 어림잡지 않고 식 (7) 로 구할 수 있다. RMSE 의 기댓값이$\sigma$ 보다 조금 작아 1.96 배 구간이 담는 확률이 95% 아래로 내려가는 것도 이 식에 들어 있으며, 그 크기는 꼭지 4.2 와 4.3 에 있다.
RMSE 는 자료마다 달라지는 확률변수여서 식 (3) 의
식 (4) 에서 RMSE 의 기댓값이 나오며, 그 값은
새 오차를 RMSE 로 나눈 값은 자유도 n 의 Student t distribution 을 따른다 [4].
식 (6) 의
식 (7) 의
Table 2. Coverage of the RMSE interval by sample count
| # | n | Coverage | Multiplier for 0.95 | |
|---|---|---|---|---|
| 1 | 5 | 0.9515 | 0.8927 | 2.5706 |
| 2 | 10 | 0.9754 | 0.9216 | 2.2281 |
| 3 | 20 | 0.9876 | 0.9359 | 2.0860 |
| 4 | 25 | 0.9901 | 0.9388 | 2.0595 |
| 5 | 28 | 0.9911 | 0.9400 | 2.0484 |
| 6 | 30 | 0.9917 | 0.9407 | 2.0423 |
| 7 | 40 | 0.9938 | 0.9430 | 2.0211 |
| 8 | 50 | 0.9950 | 0.9444 | 2.0086 |
| 9 | 100 | 0.9975 | 0.9472 | 1.9840 |
| 10 | 200 | 0.9988 | 0.9486 | 1.9719 |
| 11 | 1000 | 0.9998 | 0.9497 | 1.9623 |
Coverage 열은 n 이 커질수록 올라가 95% 에 다가가지만 어느 n 에서도 95% 에 닿지 않는다. 94% 로 반올림되는 구간은 n 이 19 부터 55 까지이고, 가장 가까운 값은 5 행의 0.9400 이다. 94.5% 를 넘으려면 n 이 56 이상, 94.9% 를 넘으려면 277 이상이어야 한다. Table 2 는 parameter 를 추정하지 않아
식 (7) 과 95% 를 지키는 배율을 n 에 대해 그리면 아래 Fig 3 와 같다.
Fig 3. Coverage of the RMSE interval and the multiplier that restores 95 percent
- (a) 식 (7) 의 확률을 n 에 대해 그린 것이다. 위의 가로선이 오차의 표준편차를 알 때의 0.9500, 아래의 가로선이 0.9400 이며, 표시한 점이 곡선과 아래 가로선이 만나는 n = 28 이다.
- (b) 95% 를 지키는 배율
$t_n(0.975)$ 를 n 에 대해 그린 것이다. 가로선이 1.96 이고, 곡선은 n 이 커지면서 그 선으로 내려온다.
확률이 낮아지는 원인은 두 가지다. 하나는 RMSE 의 기댓값이
RMSE 가 언제나 기댓값
담는 확률을 표준편차의 함수로 본
두 몫은 n 이 커지면 함께 줄어든다. n 이 10 이면 0.0059 와 0.0225, 100 이면 0.0006 과 0.0022 다.
1.96 과 95% 를 함께 적은 글은 Table 2 대로 n 이 수백 이상일 때만 근사로 맞다. 1.96 과 94% 를 함께 적은 글은 RMSE 로 오차의 표준편차를 추정했을 때 n 이 30 안팎이면 나오는 값을 적은 것이며,
Model 을 자료에 맞추어 parameter 를 p 개 추정하고 그 잔차로 RMSE 를 구했으면 자유도가
식 (8) 은 p 가 0 이면 식 (7) 로 돌아간다. n 이 28 일 때 p 가 2 이면 0.9299, 5 이면 0.9111 이다. n 이 100 이고 p 가 5 이면 0.9409 로, 같은 0.94 를 세 배가 넘는 자료로 얻는다.
- 가정: 오차가 평균 0 의 정규분포에서 독립으로 나오고 분산이 모두 같다. RMSE 를 구한 오차와 담을 대상인 새 오차가 서로 독립이다. 예측값 자체가 흔들리는 몫인 leverage 는 뺀다 (꼭지 5.2).
-
설정값: 배율은 1.96 으로 고정한다. 같은 자료로 parameter 를 p 개 추정했으면 자유도는
$\nu = n - p$ 이고, 담는 확률은 식 (8) 로 구한다. -
깨지는 조건: 오차의 평균이 0 이 아니면 RMSE 가 흩어짐과 치우침을 함께 담아 구간이 필요보다 넓어지고, 식 (7) 의 비율은 그 구간에 맞지 않는다. 오차의 분산이 입력값에 따라 다르면 (heteroscedasticity) 하나의 RMSE 가 모든 입력값의 오차를 대표하지 못해 분산이 큰 입력값에서 비율이 떨어진다. 오차가 서로 상관되어 있으면 제곱합에 남는 자유도가 n 보다 작아 식 (7) 로 구한 비율이 실제보다 높다. 꼬리가 정규분포보다 두꺼우면 같은 배율이 담는 비율이 더 낮아, 분산이 같은 Laplace distribution 에서
$\pm 1.96\sigma$ 가 담는 비율은 93.7% 다. - 만나는 자리: 계측 두 방법의 차이에 한계를 긋는 Bland-Altman 한계 [3].
Prediction interval 은 RMSE interval 의 배율 1.96 을 t distribution 에서 구한 배율로 바꾼 구간이고, 다음 오차 하나가 그 안에 들 확률이 n 과 무관하게
식 (9) 의
꼭지 4 의 RMSE interval 과는 쓰는 표준편차가 같고 배율만 다르다. RMSE interval 은 배율을 1.96 으로 고정해 담는 확률이 식 (7) 로 내려가고, prediction interval 은 식 (9) 의
이 문서의 prediction interval 은 leverage 를 뺀 간이 구간이며, 식 (9) 의 배율과 식 (8) 의 확률은 새 오차가 RMSE 를 구한 잔차와 독립이고 분산이
- 가정: 꼭지 4.6 과 같다.
-
설정값: 배율은 식 (9) 의
$\sqrt{n/\nu}; t_{\nu}(0.975)$ 이고 자유도는$\nu = n - p$ 이며, p 는 같은 자료로 추정한 parameter 의 개수다. 오차 개수 n 은 RMSE 의 정의인 식 (1) 의 분모에 따로 남아$\sqrt{n/\nu}$ 로 들어간다. -
깨지는 조건: 꼭지 4.6 과 같다. 꼭지 4.6 의 네 조건에서는 식 (9) 의 배율로도 담는 확률이
$1 - \alpha$ 로 유지되지 않는다. - 만나는 자리: 회귀 model 의 예측 오차 범위 보고, 공정 자료의 예측값에 붙이는 오차 막대, 꼭지 8 의 error limit.
Confidence interval 은 오차 하나가 아니라 오차의 평균이 들어 있을 구간이고, 같은 자유도와 같은 표준편차를 쓰면 폭이 prediction interval 의
구간은
Model 의 치우침이 0 인지 보는 데 이 구간을 쓴다. 구간이 0 을 담지 않으면 오차의 평균이 0 이 아니라는 뜻이고, 그 치우침은 꼭지 8.2 의 첫 항목대로 먼저 뺀다.
Tolerance interval 은 모집단의 비율
Prediction interval 에서는 다음 오차 하나가 들어올 확률이 평균적으로
"신뢰수준 95% 로 모집단의 99% 이상" 처럼 구간이 모집단의 몇 할을 담아야 하는지와 그것을 얼마의 신뢰수준으로 보장해야 하는지를 함께 요구할 때 쓴다. 다음 한 점이 구간에 드는지만 볼 때는 prediction interval 이 맞다.
예측값으로 SPC 를 할 때 긋는 세 한계는 각각 prediction interval, RMSE interval, Normal interval 을 쓰고, 그에 앞서 confidence interval 로 model 의 치우침을 확인한다.
-
Prediction interval: Error limit (꼭지 8.2). 다음 예측 하나의 오차를 n 과 무관하게
$1 - \alpha$ 로 담아야 하므로 식 (9) 의 배율을 쓴다. - RMSE interval: Acceptance limit 의 guard band (꼭지 8.3). ISO 14253-1 이 표준불확도에 고정 배율 2 를 곱한 확장 불확도 (expanded uncertainty) 를 spec 에서 빼라고 정하므로, RMSE 에 고정 배율을 곱하는 RMSE interval 의 꼴이 된다. 고정 배율이 담는 확률은 식 (7) 처럼 n 이 작을수록 낮아, n 이 작으면 배율을 prediction interval 의 배율 쪽으로 키운다.
-
Normal interval: Control limit (꼭지 8.4). 관리 한계는 관측 표준편차를 아는 값으로 보고 그 3 배를 더하고 빼므로, Table 1 의 1 행에서 배율이 3, 곧
$\alpha = 0.0027$ 인 경우다. - Confidence interval: Bias 확인 (꼭지 8.2 의 첫 항목). RMSE 를 구하기 전에 오차의 평균이 0 인지를 꼭지 6 의 구간으로 본다.
-
Tolerance interval: 쓰지 않는다. Spec 이 "신뢰수준
$\gamma$ 로 모집단의$P$ 이상" 을 요구하면 error limit 의 배율을 꼭지 7 의 tolerance factor 로 바꾼다.
Error limit 과 guard band 는 RMSE 로 구하고, control limit 은 공정의 변동으로 구한다. 세 한계를 견주면 Table 3 이다.
Table 3. Limits around a predicted value
| # | Limit | Set from | Offset | What it decides |
|---|---|---|---|---|
| 1 | Error limit | RMSE | 한 예측의 오차를 받아들일지 | |
| 2 | Acceptance limit | Spec 과 RMSE | 예측값으로 규격 판정을 내릴지 | |
| 3 | Control limit | 공정의 변동 | 관측 표준편차의 3 배 | 공정이 평소와 달라졌는지 |
1 행은 model 이 계측을 대신해도 되는 범위다. 2 행은 이미 있는 spec 을 안쪽으로 좁힌 한계이며, 좁힌 폭이 guard band 다. 3 행의 한계는 spec 에서 나오지 않지만, 예측값으로 chart 를 그리면 그 폭에 식 (11) 대로 RMSE 가 더해진다.
Table 3 의 1 행인 error limit 은 꼭지 5 의 식 (9) 에
- Bias 를 먼저 뺀다: 오차의 평균이 0 이 아니면 RMSE 가 치우침과 흩어짐을 함께 담아 (꼭지 4.6) 한계가 필요보다 넓어진다. 치우침을 model 에서 고친 뒤 RMSE 를 다시 구한다.
-
Model 을 맞추는 데 쓰지 않은 자료로 구한다: 그 자료로 추정한 parameter 가 없으므로
$\nu = n$ 이다. Model 을 맞춘 자료의 잔차로 구하면 자유도가$\nu = n - p$ 로 줄어 식 (7) 로 구한 확률이 실제보다 높으므로, 확률은 식 (8) 로, 배율은 식 (9) 에 그$\nu$ 를 넣어 구한다. - 오차 개수를 먼저 센다: n 이 30 안팎이면 1.96 이 담는 확률이 94% 이므로, 95% 를 error limit 에 적으려면 배율을 Table 2 에서 바꾸어 읽는다.
예측값이 계측값을 대신해 규격 판정을 내리면 spec 을 안쪽으로 좁힌 수락 한계 (acceptance limit) 를 쓴다.
식 (10) 의 두 값 사이에 들어온 것만 받아들이고, spec 과 수락 한계 사이의 폭
관리 한계는 공정의 변동에서 구하고 spec 은 요구에서 구하므로, 둘을 같은 수로 두지 않는다. 예측값으로 chart 를 그리면 관측되는 변동에 공정의 변동과 model 의 오차가 함께 들어 있다.
식 (11) 의
[1] Meeker, W. Q., Hahn, G. J., & Escobar, L. A. (2017). Statistical Intervals: A Guide for Practitioners and Researchers (2nd ed.). John Wiley & Sons. ISBN 978-0471687177.
[2] NIST/SEMATECH. (2012). e-Handbook of Statistical Methods. NIST Handbook 151, National Institute of Standards and Technology.
[3] Bland, J. M., & Altman, D. G. (1986). Statistical Methods for Assessing Agreement Between Two Methods of Clinical Measurement. The Lancet, 327(8476), 307–310.
[4] Student. (1908). The Probable Error of a Mean. Biometrika, 6(1), 1–25.
[5] JCGM. (2012). Evaluation of Measurement Data — The Role of Measurement Uncertainty in Conformity Assessment. JCGM 106:2012, Joint Committee for Guides in Metrology.
[6] ISO. (2017). Geometrical Product Specifications (GPS) — Inspection by Measurement of Workpieces and Measuring Equipment — Part 1: Decision Rules for Verifying Conformity or Nonconformity with Specifications. ISO 14253-1:2017, International Organization for Standardization.
- chi-squared distribution: 독립인 표준정규분포 값 여러 개를 제곱해 더한 값이 따르는 분포. 식 (15) 가 정의다.
- concave: 2차 도함수가 음수여서 곡선이 위로 볼록한 함수의 성질.
- confidence interval: 추정하려는 모수가 들어 있을 확률을 정해 둔 구간.
- consumer's risk: 받아들인 것이 규격을 벗어나 있을 확률.
- control limit: 공정이 평소와 같은지를 가르는 chart 의 한계. 공정의 변동에서 구한다.
- coverage: 구간이 담으려는 대상을 실제로 담을 확률.
- coverage factor: 표준불확도에 곱해 확장 불확도를 얻는 수. 관례는 2 다.
- degrees of freedom: 제곱합에 남아 있는 독립한 성분의 개수.
- expanded uncertainty: 표준불확도에 coverage factor 를 곱한 값.
- gamma function: 식 (19) 의 적분으로 정의되는 함수. 양의 정수에서 계승 (factorial) 을 확장한 값이 된다.
- guard band: Spec 과 수락 한계 사이의 폭. 식 (10) 가 정의다.
- heteroscedasticity: 오차의 분산이 입력값이나 공정 수준에 따라 다른 상태.
- Jensen's inequality: concave 함수에서 기댓값의 함수가 함수의 기댓값보다 크다는 부등식.
- Laplace distribution: 양쪽 꼬리가 지수함수로 줄어드는 대칭 분포. 분산이 같은 정규분포보다 꼬리가 두껍다.
- leverage: 새 입력이 자료의 중심에서 떨어진 정도를 재는 값. 예측값 자체가 흔들리는 몫을 정한다.
- lower incomplete gamma function: gamma function 의 적분 구간을 유한한 위끝에서 끊은 함수. 식 (18) 이 정의다.
- Monte Carlo: 난수로 표본을 만들어 확률을 추정하는 방법.
- prediction interval: 새 관측 하나가 들어 있을 확률을 정해 둔 구간.
- process capability index: Spec 의 폭을 공정 변동의 6 배로 나눈 값.
- producer's risk: 거부한 것이 규격 안에 있을 확률.
-
quantile function: 누적분포함수의 역함수. 확률
$q$ 에 대해 누적확률이$q$ 가 되는 값을 준다. 식 (13) 가 정의다. - regularized incomplete gamma function: lower incomplete gamma function 을 gamma function 으로 나눈 값. 식 (17) 의 우변이 그 값이다.
- RMSE: 오차 제곱의 평균에 제곱근을 취한 값. 식 (1) 이 정의다.
- spec limit: 요구에서 나온 상한과 하한. 공정의 변동과는 따로 정해진다.
- Student t distribution: 표준정규분포 값을, 그와 독립인 chi-squared 값을 자유도로 나눈 것의 제곱근으로 나눈 비가 따르는 분포.
- tolerance factor: tolerance interval 에서 표준편차에 곱하는 배율. 비율과 신뢰수준과 표본 수로 정해진다.
- tolerance interval: 모집단의 정해진 비율을 담는다는 것을 정해진 신뢰수준으로 보장하는 구간.
- unbiased estimator: 기댓값이 추정 대상과 같은 추정량.
누적분포함수는 값
식 (12) 의
양쪽 꼬리에 합쳐
자유도
서로 독립이고 표준정규분포
-
$k$ (자유도, degrees of freedom): 합산되는 독립 표준정규분포 변수의 개수.
본문에서는 같은 자유도를 n 과
자유도가
식 (16) 의
누적분포함수
식 (17) 의
Chi-squared distribution 의 누적분포함수는 닫힌 형태 (elementary function) 로 단순하게 표현되지 않는다. 그래서 식 (17) 처럼 정규화 불완전 감마 함수 (regularized incomplete gamma function) 의 꼴로 정의하고, 실제 계산에는 numerical 방법이나 R, Python, Excel 이 담은 통계 함수를 쓴다.
-
Range:
$X \ge 0$ . 제곱합이므로 음수가 되지 않는다. -
Mean:
$E(X) = k$ . -
Variance:
$\mathrm{Var}(X) = 2k$ . -
Shape:
$k$ 가 작을수록 오른쪽으로 긴 꼬리를 가진 비대칭 형태이며,$k$ 가 커질수록 점점 정규분포 모양에 가깝게 대칭형으로 변한다.
출발점은 오차 하나를
두 번째 등식은 식 (1) 의 양변을 제곱해 n 을 곱한 것이며, 이것이 식 (4) 다. 식 (5) 는 여기서 제곱근의 기댓값으로 나온다. 자유도 n 의 chi-squared 값에 제곱근을 취한 값의 기댓값이 아래이다.
식 (20) 에서
식 (6) 은 t distribution 의 정의에서 나온다. 새 오차
식 (22) 의 가운데에서
Parameter 를 p 개 추정한 경우에는 제곱합의 자유도가
식 (23) 의 좌변이 1.96 이하일 조건은

