| | |

Intervals from the RMSE and Their Use in SPC

Intervals from the RMSE and Their Use in SPC

Version 8 | Created: 2026-10-09 | Updated: 2026-11-07 13:46 UTC

1. Purpose

  • 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.

2. Summary

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.

3. Taxonomy and its Hierarchy

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 $\sigma$ is known the multiplier is applied to that true value instead. Two things set the multiplier: whether the standard deviation of the errors (scale) is known or estimated, and what the interval is meant to cover (covered quantity). The two axes are shown in Fig 1 below.

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 $\sigma$ is no longer assumed known, the hierarchy branches into the second row (RMSE interval) and the third row (prediction interval) of Fig 2. Keeping the multiplier at $z(1 - \alpha/2)$ lets the probability fall below $1 - \alpha$; holding $1 - \alpha$ requires raising the multiplier to $\sqrt{n/\nu}; t_{\nu}(1 - \alpha/2)$ of Eq. (9), which is $t_{n}(1 - \alpha/2)$ when $\nu = n$. The fourth row (tolerance interval) puts a confidence level on the covered probability, and with that confidence above 0.5 its multiplier exceeds the third row's.

3.1 Comparison

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 $\sigma$ $z(1 - \alpha/2)$ One new error $1 - \alpha$
2 RMSE interval RMSE $z(1 - \alpha/2)$ One new error Value of Eq. (7)
3 Prediction interval RMSE $\sqrt{n/\nu}; t_{\nu}(1 - \alpha/2)$ One new error $1 - \alpha$
4 Confidence interval $s / \sqrt{n}$ $t_{n-1}(1 - \alpha/2)$ Mean of the errors $1 - \alpha$
5 Tolerance interval RMSE tolerance factor At least a fraction $P$ of the population Confidence $\gamma$

At $\alpha = 0.05$ the multiplier is 1.96 in rows 1 and 2, $\sqrt{n/\nu}; t_{\nu}(0.975)$ in row 3 and $t_{n-1}(0.975)$ in row 4. Row 1 applies only when $\sigma$ is known; from row 2 on, a value computed from the sample stands in for $\sigma$. Rows 2 and 3 put different multipliers on the same standard deviation, and because the multiplier of row 3 comes from the t distribution with $\nu$ degrees of freedom as in Eq. (9), its probability stays at $1 - \alpha$ for every n. Row 4 is about $1/\sqrt{n}$ as wide as row 3 and covers the mean of the errors rather than a new error, so it cannot replace row 2. The $s$ of row 4, unlike the RMSE of Eq. (1), is the standard deviation computed after subtracting the mean of the errors and dividing by n - 1, with n - 1 degrees of freedom. Row 5 attaches a different meaning to its probability than the other four. Row 3 means a new error falls in the interval with probability $1 - \alpha$ on average; row 5 means the interval covers at least a fraction $P$ of the population with confidence $\gamma$, so the covered fraction itself carries a probability. Its multiplier is the tolerance factor fixed by $P$, $\gamma$ and n [1]. The tolerance factor has no closed form and is read from tables for each combination of the three [2].

4. RMSE Interval

This section gives Eq. (2), which draws the RMSE interval, and Eq. (7), the probability that this interval holds one new error. The unknown $\sigma$ cancels in the derivation of Eq. (7), so this probability depends only on the error count n.

4.1 Interval Calculation

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.

$$\mathrm{RMSE} = \sqrt{\frac{1}{n}\sum_{i=1}^{n} e_i^2} \hspace{19em} (1)$$

The error $e_i$ in Eq. (1) is the i-th predicted value of the model minus the i-th measured value, and $e_1, \dots, e_n$ are n such differences drawn independently from a normal distribution with mean 0 and variance $\sigma^2$.

$$\mathrm{LSL},\ \mathrm{USL} = \mu_0 \mp 1.96\,\mathrm{RMSE} \hspace{19em} (2)$$

In Eq. (2), $\mu_0$ is the center of the interval, 0 for an interval on the errors. The multiplier 1.96 holds 95% when $\sigma$ is known, and with the RMSE standing in for $\sigma$ the probability falls short of 95%. The size of the shortfall is in section 4.2, and the multiplier that holds 95% is Eq. (9) of section 5.

Using the RMSE in Place of Sigma 🎈

Two facts let the RMSE stand in for $\sigma$.

  • 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.

4.2 Interval Coverage

With $\sigma$ known, an interval of 1.96 times $\sigma$ holds 95.00% for every n; with the RMSE in place of $\sigma$ it holds less.

$$P\left(|e| \le 1.96\,\sigma\right) = 2\Phi(1.96) - 1 = 0.9500 \hspace{19em} (3)$$

$\Phi$ is the CDF of the standard normal distribution, and 1.96 is its two-sided 95% point cut at the second decimal place. The uncut value is 1.95996, and the 0.950004 that the 1.96 interval holds differs from 95% at the sixth decimal place. This is the value behind the convention of reporting limits as the mean difference plus or minus 1.96 standard deviations when two measurement methods are compared [3]. The 1.96 corresponds to a target probability of 95%; a different target replaces it with its own two-sided point. This document uses 95%, as is customary.

The RMSE varies from one data set to the next, so it cannot simply replace the $\sigma$ of Eq. (3). The sum of squares divided by $\sigma^2$ follows a chi-squared distribution with n degrees of freedom; its definition, density and CDF are in Appendix C.

$$\frac{n\,\mathrm{RMSE}^2}{\sigma^2} \sim \chi^2_n \hspace{19em} (4)$$

Eq. (4) gives the expected value of the RMSE, which is $\sigma$ times a constant below 1.

$$E[\mathrm{RMSE}] = c_n\,\sigma, \qquad c_n = \sqrt{\frac{2}{n}}\;\frac{\Gamma\!\left(\frac{n+1}{2}\right)}{\Gamma\!\left(\frac{n}{2}\right)} \hspace{19em} (5)$$

$c_n$ tends to 1 as n grows: 0.9754 at n = 10, 0.9911 at 28 and 0.9975 at 100. The derivation is in Appendix D.

A new error divided by the RMSE follows Student's t distribution with n degrees of freedom [4].

$$\frac{e^{\ast}}{\mathrm{RMSE}} \sim t_n \hspace{19em} (6)$$

The $e^{\ast}$ in Eq. (6) is the error of the model's next prediction. It did not exist when the RMSE was computed, so it is independent of the n errors behind the RMSE. With the denominator changed from the constant $\sigma$ to the random RMSE, the ratio follows a t distribution instead of the standard normal, and the probability changes with it.

$$P\left(|e^{\ast}| \le 1.96\,\mathrm{RMSE}\right) = 2F_{t_n}(1.96) - 1 \hspace{19em} (7)$$

$F_{t_n}$ in Eq. (7) is the CDF of the t distribution with n degrees of freedom. Table 2 lists its value at each n and the multiplier that holds 95% in place of 1.96.

Table 2. Coverage of the RMSE interval by sample count

# n $c_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 $\nu = n$ with no fitted parameters; with fitted parameters the value comes from Eq. (8) in section 4.5. The values of Eq. (7) agree to the third decimal place with a Monte Carlo run of 2 million draws at n = 10, 28 and 100.

Eq. (7) and the multiplier that keeps 95%, plotted against n, are shown in Fig 3 below.

Fig 3

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.

4.3 Coverage Loss

The probability drops for two reasons. One is that the expected RMSE is smaller than $\sigma$; the other is that the RMSE varies from one data set to the next.

If the RMSE always equaled its expected value $c_n\sigma$, the probability would be $2\Phi(1.96,c_n) - 1$. At n = 28 that is 0.9479, so the smaller expected value lowers the probability by 0.0021. The actual probability is 0.9400, so the remaining 0.0079 is the drop caused by the variation of the RMSE.

The probability as a function of the standard deviation, $g(u) = 2\Phi(1.96,u) - 1$, is concave for $u \gt 0$. Jensen's inequality gives $E[g(U)] \lt g(E[U])$, so the probability gained when the RMSE exceeds its expected value is smaller than the probability lost when it falls short, and the average goes down.

Both parts shrink together as n grows: 0.0059 and 0.0225 at n = 10, 0.0006 and 0.0022 at n = 100.

4.4 Coverage Stated with 1.96

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 $\sigma$ known, the multiplier that holds 94% is 1.88.

4.5 Degrees of Freedom with Fitted Parameters

When p parameters are fitted to the data and the RMSE is computed from the residuals, the degrees of freedom drop to $\nu = n - p$, and the same 1.96 holds a smaller fraction.

$$P\left(|e^{\ast}| \le 1.96\,\mathrm{RMSE}\right) = 2F_{t_{\nu}}\!\left(1.96\sqrt{\frac{\nu}{n}}\right) - 1, \qquad \nu = n - p \hspace{19em} (8)$$

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.

4.6 Conditions

  • 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].

5. Prediction Interval

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 $1 - \alpha$ for every n.

$$\mathrm{LSL},\ \mathrm{USL} = \mu_0 \mp k\,\mathrm{RMSE}, \qquad k = \sqrt{\frac{n}{\nu}}\; t_{\nu}\!\left(1 - \frac{\alpha}{2}\right) \hspace{19em} (9)$$

In Eq. (9), $\mu_0$ is as in Eq. (2). $k$ is the multiplier set by the target probability $1 - \alpha$, and $\sqrt{n/\nu}$ is a correction factor that compensates for the RMSE dividing its sum of squares by n rather than $\nu$. With no fitted parameters, $\nu = n$, the correction factor is 1, and $k = t_n(1 - \alpha/2)$, which is 2.05 at $\alpha = 0.05$ and n = 28, the last column of Table 2. With p fitted parameters, $\nu = n - p$ goes into the formula, and n = 28 with p = 2 gives 2.13.

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 $k$ of Eq. (9) and keeps the probability at $1 - \alpha$.

5.1 The Multiplier for 95 Percent

At $\alpha = 0.05$ the multiplier is 2.05 at n = 28, 2.01 at 50 and 1.98 at 100.

5.2 Leverage

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 $\sigma^2$. The error left after subtracting the model's prediction at a new input $x^{\ast}$ has variance $\sigma^2(1 + h)$ rather than $\sigma^2$, where $h$ is the leverage of that input, the variation of the predicted value itself. For linear regression, $h = 1/n + (x^{\ast} - \bar{x})^2 / \sum (x_i - \bar{x})^2$. With $h$ above 0, the probability actually held is below $1 - \alpha$ for the interval of Eq. (9) and below the value of Eq. (8) for the 1.96 interval, and it falls further the farther the input lies from the center of the data.

5.3 Conditions

  • 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.

6. Confidence Interval

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 $1/\sqrt{n}$ as wide as the prediction interval.

The interval is $\bar{e} \pm t_{\nu}(1 - \alpha/2), s / \sqrt{n}$, where $\bar{e}$ is the mean of the n errors, $s$ is the standard deviation computed after subtracting that mean, and the degrees of freedom are $\nu = n - 1$. Since it covers a mean, its width shrinks to 0 as n grows, while the width of the prediction interval keeps $\sigma$ and does not. Using one for the other draws an interval $\sqrt{n}$ times too narrow where a single error has to be covered.

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.

7. Tolerance Interval

The tolerance interval guarantees, with confidence $\gamma$, that it covers a fraction $P$ of the population.

In the prediction interval the next error falls inside with probability $1 - \alpha$ on average; in the tolerance interval the probability that the interval covers at least a fraction $P$ of the population is $\gamma$. With the confidence above 0.5 the added requirement raises the multiplier, so at the same n and fraction it is wider than the prediction interval. Its multiplier is the tolerance factor fixed by $P$, $\gamma$ and n, which has no closed form and is read from tables for each combination [1] [2].

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.

8. Spec Setting for SPC

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.

8.1 What the Limit Is Drawn On

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 $k,\mathrm{RMSE}$ Whether to accept the error of one prediction
2 Acceptance limit Spec and RMSE $g,\mathrm{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).

8.2 The Limit from the RMSE

The error limit, row 1 of Table 3, is Eq. (9) of section 5 with $\mu_0 = 0$. The spec is set separately from the requirement, and the RMSE enters it only through the guard band of section 8.3. At $\alpha = 0.05$ and $\nu = n = 28$ the multiplier is 2.05, the value in the last column of Table 2. Check three things before using it.

  • 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.

8.3 The Guard Band

When a predicted value replaces a measured value in a conformity decision, the decision uses an acceptance limit narrowed inward from the spec.

$$A_{\mathrm{L}} = \mathrm{LSL} + g\,\mathrm{RMSE}, \qquad A_{\mathrm{U}} = \mathrm{USL} - g\,\mathrm{RMSE} \hspace{19em} (10)$$

Only items between the two values of Eq. (10) are accepted, and the width $g,\mathrm{RMSE}$ between the spec and the acceptance limit is the guard band. An item measured just inside the spec can have a true value outside it, with a probability that grows with the RMSE. The guard band lowers that probability, the consumer's risk [5]. The default rule of ISO 14253-1 subtracts one expanded uncertainty from the spec [6]. Taking the RMSE as the standard uncertainty makes $g$ the coverage factor, and the customary coverage factor of 2 gives $g = 2$. For small n a value above 2 is used, for the same reason that $k$ in Eq. (9) grows. A larger $g$ lowers the consumer's risk at the cost of a higher probability of rejecting conforming items, the producer's risk.

8.4 The Spec and the Control Limit

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.

$$\sigma_{\mathrm{obs}}^2 = \sigma_{\mathrm{proc}}^2 + \mathrm{RMSE}^2 \hspace{19em} (11)$$

The $\sigma_{\mathrm{obs}}$ of Eq. (11) sets the width of the control limits, so an RMSE of half the process standard deviation widens them 1.12 times and lowers the process capability index measured on the same data to 0.89 times its value. An RMSE equal to the process standard deviation gives 1.41 and 0.71 times. Eq. (11) holds when the model error is independent of the process variation; if the error changes with the process level (heteroscedasticity), one RMSE cannot set the limits at every process level.

References

[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.


Appendix A. Terminology

  • 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.

Appendix B. Quantile Functions of the Normal and t Distributions

B.1 Normal Distribution

From the Cumulative Distribution Function to Its Inverse

A CDF gives, for a value $x$, the probability of being at most $x$; a quantile function goes the other way and gives, for a probability $q$, the value with cumulative probability $q$. The CDF of the standard normal distribution is written $\Phi$.

$$\Phi(x) = P(Z \le x), \qquad Z \sim N(0, 1) \hspace{19em} (12)$$

$\Phi$ in Eq. (12) is continuous and only increases with $x$, so for each probability $q$ between 0 and 1 exactly one $x$ satisfies $\Phi(x) = q$. That $x$ is written $z(q)$, and it is the inverse of $\Phi$.

$$z(q) = \Phi^{-1}(q), \qquad \Phi(z(q)) = q \hspace{19em} (13)$$

$z(0.5)$ is 0 and $z(0.975)$ is 1.96. The first is the median, and the second is the value below which 97.5% of the distribution lies.

The Two-sided Point

The two ends of an interval that leaves $\alpha$ in the two tails together are $\pm z(1 - \alpha/2)$. The distribution is symmetric, so each tail holds $\alpha/2$, and the point with $\alpha/2$ in the upper tail is the point with cumulative probability $1 - \alpha/2$ below it.

$$P\left(|Z| \le z(1 - \alpha/2)\right) = 1 - \alpha \hspace{19em} (14)$$

With $\alpha = 0.05$, $z(0.975) = 1.96$, and Eq. (14) becomes Eq. (3).

B.2 t Distribution

Student's t distribution with $\nu$ degrees of freedom uses $t(\nu, q)$ in the same way. It is the inverse of the CDF $F_{t_{\nu}}$ of that distribution, and $t(\nu, 1 - \alpha/2)$ is the point that leaves $\alpha$ in the two tails together. The t distribution has heavier tails than the normal, so at the same $q$ it exceeds $z(q)$, and it approaches $z(q)$ as $\nu$ grows. At $\alpha = 0.05$, $t(28, 0.975)$ is 2.05 and $t(1000, 0.975)$ is 1.96.

Appendix C. Chi-squared Distribution

C.1 Definition

Given $k$ independent random variables $Z_1, Z_2, \dots, Z_k$, each standard normal $N(0, 1)$, the random variable $X$ defined as their sum of squares follows the chi-squared distribution with $k$ degrees of freedom.

$$X = \sum_{i=1}^{k} Z_i^2 = Z_1^2 + Z_2^2 + \dots + Z_k^2 \sim \chi^2(k) \hspace{19em} (15)$$
  • $k$ (degrees of freedom): The number of independent standard normal variables summed.

The main text writes the same degrees of freedom as n and $\nu$. The $S$ of Eq. (20) is the $X$ of Eq. (15) with $k = n$, and the $S_{\nu}$ of Eq. (23) is the same with $k = \nu$.

C.2 Probability Density Function

The probability density function of the chi-squared distribution with $k$ degrees of freedom is, for $x \gt 0$, as follows.

$$f(x; k) = \frac{1}{2^{k/2}\,\Gamma(k/2)}\; x^{(k/2) - 1}\, e^{-x/2} \hspace{19em} (16)$$

$\Gamma$ in Eq. (16) is the gamma function, defined by Eq. (19).

C.3 Cumulative Distribution Function

The CDF $F(x; k)$ is the probability $P(X \le x)$ that $X$ is at most $x$, obtained by integrating the density from 0 to $x$.

$$F(x; k) = P(X \le x) = \frac{1}{\Gamma(k/2)}\; \gamma\!\left(\frac{k}{2}, \frac{x}{2}\right) \quad (x \ge 0) \hspace{19em} (17)$$

$\gamma(s, t)$ in Eq. (17) is the lower incomplete gamma function, and $\Gamma(s)$ is the gamma function, the same integral with its upper limit taken to infinity.

$$\gamma(s, t) = \int_0^t u^{s-1} e^{-u}\, du \hspace{19em} (18)$$ $$\Gamma(s) = \int_0^{\infty} u^{s-1} e^{-u}\, du \hspace{19em} (19)$$

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.

C.4 Properties

  • 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.

Appendix D. Derivation of Equations (4) to (8)

The starting point is a single fact: an error divided by $\sigma$ is standard normal. The sum of the squares of n of them follows a chi-squared distribution with n degrees of freedom.

$$S = \sum_{i=1}^{n} \left(\frac{e_i}{\sigma}\right)^2 \sim \chi^2_n, \qquad S = \frac{n\,\mathrm{RMSE}^2}{\sigma^2} \hspace{19em} (20)$$

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.

$$E\left[\sqrt{S}\right] = \sqrt{2}\;\frac{\Gamma\!\left(\frac{n+1}{2}\right)}{\Gamma\!\left(\frac{n}{2}\right)} \hspace{19em} (21)$$

Eq. (20) gives $\mathrm{RMSE} = \sigma\sqrt{S/n}$, so taking expected values and substituting Eq. (21) yields the $c_n$ of Eq. (5).

Eq. (6) follows from the definition of the t distribution. The new error $e^{\ast}$ is independent of $e_1, \dots, e_n$, so $Z = e^{\ast}/\sigma$ is a standard normal value independent of S.

$$\frac{e^{\ast}}{\mathrm{RMSE}} = \frac{\sigma Z}{\sigma\sqrt{S/n}} = \frac{Z}{\sqrt{S/n}} \sim t_n \hspace{19em} (22)$$

$\sigma$ cancels in the middle of Eq. (22), so the covered fraction does not depend on the unknown $\sigma$ and is fixed by n alone. The probability that the absolute value of the left-hand side is at most 1.96, written with the CDF of the t distribution, is Eq. (7).

With p fitted parameters, the degrees of freedom of the sum of squares drop to $\nu = n - p$, but the RMSE still divides by n as in Eq. (1). Writing the chi-squared value with that many degrees of freedom as $S_{\nu}$ leaves the two numbers separate.

$$\frac{e^{\ast}}{\mathrm{RMSE}} = \frac{Z}{\sqrt{S_{\nu}/n}} = \sqrt{\frac{n}{\nu}}\;\frac{Z}{\sqrt{S_{\nu}/\nu}} \sim \sqrt{\frac{n}{\nu}}\;t_{\nu} \hspace{19em} (23)$$

The left-hand side of Eq. (23) is at most 1.96 exactly when $t_{\nu}$ is at most $1.96\sqrt{\nu/n}$, and writing that with the CDF gives Eq. (8). The $c_n$ of Eq. (5) also shrinks by a further factor of $\sqrt{\nu/n}$ when n is replaced by $\nu$.

Intervals from the RMSE and Their Use in SPC

Version 51 | Created: 2026-10-05 | Updated: 2026-11-07 13:46 UTC

1. Purpose

  • Problem Statement: ML 의 metric 인 RMSE 의 물리적 의미를 이해하기 힘들다.
  • Goal: model 의 오차인 RMSE 를 이용해 SPC 에서 spec 과 함께 쓸 한계 (error limit 과 guard band) 를 정하는 방법의 이론과 실행을 담은 guide 를 만든다.
  • Non-Goal: 오차가 정규분포가 아닐 때 쓸 구간은 다루지 않는다.

2. Summary

이 문서는 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 만큼 안쪽으로 좁혀 판정한다.

3. Taxonomy and its Hierarchy

구간의 크기는 model 의 오차인 RMSE 의 배율로 구한다. 구간의 두 끝은 중심에 RMSE 의 배율 배를 더하고 뺀 값이며, $\sigma$ 를 아는 경우에는 RMSE 대신 그 참값에 배율을 곱한다. 배율을 정하는 것은 두 가지다. 오차의 표준편차 (scale) 를 아는가 추정하는가, 그리고 구간이 담는 대상 (covered quantity) 이 무엇인가이다. 두 축은 아래 Fig 1 과 같다.

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 개의 오차로 추정하며, 맨 아래는 추정한 표준편차로 모집단의 비율까지 보장한다. $\sigma$ 를 안다는 가정을 버리면 Fig 2 의 둘째 줄 (RMSE interval) 과 셋째 줄 (prediction interval) 로 갈린다. 배율을 $z(1 - \alpha/2)$ 에 그대로 두면 담는 확률이 $1 - \alpha$ 아래로 떨어지고, $1 - \alpha$ 를 지키려면 배율을 식 (9) 의 $\sqrt{n/\nu}; t_{\nu}(1 - \alpha/2)$ 로 키우며, $\nu = n$ 이면 $t_{n}(1 - \alpha/2)$ 다. 넷째 줄 (tolerance interval) 은 담는 확률에 신뢰수준을 하나 더 붙이며, 그 신뢰수준을 0.5 보다 높게 두면 배율이 셋째 줄보다 커진다.

3.1 Comparison

Table 1 에는 구간마다 Fig 1 의 두 축에서 고른 값, 곧 쓰는 표준편차와 담는 대상이 있고, 그 둘로 정해지는 배율과 확률도 함께 있다. 쓸 구간은 가진 표준편차와 담아야 하는 대상으로 이 표에서 고른다.

Table 1. Intervals around a prediction

# Interval Scale Multiplier Covered quantity Probability
1 Normal interval $\sigma$ $z(1 - \alpha/2)$ 새 오차 하나 $1 - \alpha$
2 RMSE interval RMSE $z(1 - \alpha/2)$ 새 오차 하나 식 (7) 의 값
3 Prediction interval RMSE $\sqrt{n/\nu}; t_{\nu}(1 - \alpha/2)$ 새 오차 하나 $1 - \alpha$
4 Confidence interval $s / \sqrt{n}$ $t_{n-1}(1 - \alpha/2)$ 오차의 평균 $1 - \alpha$
5 Tolerance interval RMSE tolerance factor 모집단의 비율 $P$ 이상 신뢰수준 $\gamma$

$\alpha = 0.05$ 에서 1 행과 2 행의 배율이 1.96, 3 행의 배율이 $\sqrt{n/\nu}; t_{\nu}(0.975)$, 4 행의 배율이 $t_{n-1}(0.975)$ 다. 1 행은 $\sigma$ 를 아는 경우에만 쓸 수 있고, 2 행부터는 모두 표본에서 구한 값으로 $\sigma$ 를 대신한다. 2 행과 3 행은 같은 표준편차에 다른 배율을 곱한 것이며, 3 행의 배율이 식 (9) 대로 자유도 $\nu$ 의 t distribution 에서 나온 값이라 비율이 n 과 무관하게 $1 - \alpha$ 로 유지된다. 4 행은 폭이 3 행의 약 $1/\sqrt{n}$ 이고, 담는 대상이 새 오차가 아니라 오차의 평균이므로 2 행과 바꾸어 쓸 수 없다. 4 행의 $s$ 는 식 (1) 의 RMSE 와 달리 오차의 평균을 뺀 뒤 n - 1 로 나누어 구한 표준편차이고, 자유도는 n - 1 이다. 5 행은 다른 네 행과 확률의 뜻이 다르다. 3 행은 새 오차 하나가 구간에 들 확률이 평균적으로 $1 - \alpha$ 라는 뜻이고, 5 행은 구간이 모집단의 $P$ 이상을 담는다는 것을 신뢰수준 $\gamma$ 로 보장한다는 뜻이어서 담는 비율에 다시 확률이 붙는다. 배율은 $P$ 와 $\gamma$ 와 n 의 세 값으로 정해지는 tolerance factor 다 [1]. Tolerance factor 는 닫힌 형태가 없어 세 값의 조합마다 표에서 읽는다 [2].

4. RMSE Interval

이 꼭지는 RMSE interval 을 긋는 식 (2) 와, 그 구간이 새 오차 하나를 담는 확률을 구하는 식 (7) 을 다룬다. 식 (7) 을 유도하면 모르는 $\sigma$ 가 약분되므로, 이 확률은 오차의 개수 n 하나로 정해진다.

4.1 Interval Calculation

구간의 두 끝은 중심에 RMSE 의 1.96 배를 더하고 뺀 값이고, RMSE 는 오차 n 개의 제곱평균제곱근이다.

$$\mathrm{RMSE} = \sqrt{\frac{1}{n}\sum_{i=1}^{n} e_i^2} \hspace{19em} (1)$$

식 (1) 의 오차 $e_i$ 는 model 의 i 번째 예측값에서 i 번째 계측값을 뺀 차이이고, $e_1, \dots, e_n$ 은 평균 0, 분산 $\sigma^2$ 의 정규분포에서 독립으로 나온 그 차이 n 개다.

$$\mathrm{LSL},\ \mathrm{USL} = \mu_0 \mp 1.96\,\mathrm{RMSE} \hspace{19em} (2)$$

식 (2) 의 $\mu_0$ 는 구간의 중심이고, 오차에 긋는 구간에서는 0 이다. 배율 1.96 은 $\sigma$ 를 알 때 95% 를 담는 값이며, RMSE 가 $\sigma$ 를 대신하면 담는 확률이 95% 에 미치지 못한다. 얼마나 모자라는지는 꼭지 4.2 에, 95% 를 지키는 배율은 꼭지 5 의 식 (9) 에 있다.

Using the RMSE in Place of Sigma 🎈

$\sigma$ 대신 RMSE 를 쓸 수 있는 근거는 둘이다.

  • 기댓값: 오차의 평균이 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 에 있다.

4.2 Interval Coverage

$\sigma$ 를 알면 1.96 배로 그린 구간이 담는 확률은 n 과 무관하게 95.00% 이고, $\sigma$ 대신 RMSE 를 쓰면 그보다 낮아진다.

$$P\left(|e| \le 1.96\,\sigma\right) = 2\Phi(1.96) - 1 = 0.9500 \hspace{19em} (3)$$

$\Phi$ 는 표준정규분포의 누적분포함수이고, 1.96 은 그 분포의 양측 95% 점을 소수 둘째 자리에서 끊은 값이다. 끊지 않은 값은 1.95996 이며, 1.96 배 구간이 담는 비율 0.950004 는 95% 와 소수 여섯째 자리에서 갈린다. 계측 두 방법의 차이를 견줄 때 차이의 평균에 표준편차의 1.96 배를 더하고 빼어 한계를 적는 관례가 이 값을 쓴다 [3]. 1.96 은 담을 확률을 95% 로 정했을 때의 값이며, 다른 확률을 정하면 1.96 대신 그 확률의 양측 점이 들어간다. 이 문서는 관례대로 95% 를 쓴다.

RMSE 는 자료마다 달라지는 확률변수여서 식 (3) 의 $\sigma$ 를 그대로 대신하지 못한다. 제곱합을 $\sigma^2$ 으로 나눈 값은 자유도 n 의 chi-squared distribution 을 따르며, 그 정의와 확률밀도함수와 누적분포함수는 Appendix C 에 있다.

$$\frac{n\,\mathrm{RMSE}^2}{\sigma^2} \sim \chi^2_n \hspace{19em} (4)$$

식 (4) 에서 RMSE 의 기댓값이 나오며, 그 값은 $\sigma$ 에 1 보다 작은 상수를 곱한 것이다.

$$E[\mathrm{RMSE}] = c_n\,\sigma, \qquad c_n = \sqrt{\frac{2}{n}}\;\frac{\Gamma\!\left(\frac{n+1}{2}\right)}{\Gamma\!\left(\frac{n}{2}\right)} \hspace{19em} (5)$$

$c_n$ 은 n 이 커지면 1 로 간다. n 이 10 이면 0.9754, 28 이면 0.9911, 100 이면 0.9975 다. 유도는 Appendix D 에 있다.

새 오차를 RMSE 로 나눈 값은 자유도 n 의 Student t distribution 을 따른다 [4].

$$\frac{e^{\ast}}{\mathrm{RMSE}} \sim t_n \hspace{19em} (6)$$

식 (6) 의 $e^{\ast}$ 는 model 이 다음에 내놓을 예측 하나의 오차다. RMSE 를 구하던 때에는 아직 생기지 않았으므로 RMSE 를 구한 n 개와 독립이다. 분모가 상수 $\sigma$ 에서 확률변수 RMSE 로 바뀌면서 비 (ratio) 의 분포가 표준정규분포에서 t distribution 으로 옮겨 가고, 담는 확률도 그만큼 달라진다.

$$P\left(|e^{\ast}| \le 1.96\,\mathrm{RMSE}\right) = 2F_{t_n}(1.96) - 1 \hspace{19em} (7)$$

식 (7) 의 $F_{t_n}$ 은 자유도 n 의 t distribution 의 누적분포함수다. n 마다 그 값과, 95% 를 지키려면 1.96 대신 쓸 배율은 Table 2 이다.

Table 2. Coverage of the RMSE interval by sample count

# n $c_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 를 추정하지 않아 $\nu = n$ 인 경우이고, 추정했으면 꼭지 4.5 의 식 (8) 로 구한다. 식 (7) 의 값은 200 만 회의 Monte Carlo 와 n 이 10, 28, 100 인 세 경우에서 소수 셋째 자리까지 같다.

식 (7) 과 95% 를 지키는 배율을 n 에 대해 그리면 아래 Fig 3 와 같다.

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 이 커지면서 그 선으로 내려온다.

4.3 Coverage Loss

확률이 낮아지는 원인은 두 가지다. 하나는 RMSE 의 기댓값이 $\sigma$ 보다 작은 것이고, 다른 하나는 RMSE 가 자료마다 흔들리는 것이다.

RMSE 가 언제나 기댓값 $c_n\sigma$ 와 같다면 담는 확률은 $2\Phi(1.96,c_n) - 1$ 이 된다. n 이 28 이면 그 값이 0.9479 이므로, 기댓값이 작아서 낮아지는 몫은 0.0021 이다. 실제 확률이 0.9400 이므로 나머지 0.0079 는 RMSE 가 흔들려서 낮아지는 몫이다.

담는 확률을 표준편차의 함수로 본 $g(u) = 2\Phi(1.96,u) - 1$ 은 $u \gt 0$ 에서 concave 이다. Jensen's inequality 가 $E[g(U)] \lt g(E[U])$ 를 주므로, RMSE 가 기댓값보다 커질 때 얻는 확률이 작아질 때 잃는 확률보다 적고 평균이 내려간다.

두 몫은 n 이 커지면 함께 줄어든다. n 이 10 이면 0.0059 와 0.0225, 100 이면 0.0006 과 0.0022 다.

4.4 Coverage Stated with 1.96

1.96 과 95% 를 함께 적은 글은 Table 2 대로 n 이 수백 이상일 때만 근사로 맞다. 1.96 과 94% 를 함께 적은 글은 RMSE 로 오차의 표준편차를 추정했을 때 n 이 30 안팎이면 나오는 값을 적은 것이며, $\sigma$ 를 알 때 94% 를 담는 배율은 1.88 이다.

4.5 Degrees of Freedom with Fitted Parameters

Model 을 자료에 맞추어 parameter 를 p 개 추정하고 그 잔차로 RMSE 를 구했으면 자유도가 $\nu = n - p$ 로 줄고, 같은 1.96 이 담는 비율이 더 내려간다.

$$P\left(|e^{\ast}| \le 1.96\,\mathrm{RMSE}\right) = 2F_{t_{\nu}}\!\left(1.96\sqrt{\frac{\nu}{n}}\right) - 1, \qquad \nu = n - p \hspace{19em} (8)$$

식 (8) 은 p 가 0 이면 식 (7) 로 돌아간다. n 이 28 일 때 p 가 2 이면 0.9299, 5 이면 0.9111 이다. n 이 100 이고 p 가 5 이면 0.9409 로, 같은 0.94 를 세 배가 넘는 자료로 얻는다.

4.6 Conditions

  • 가정: 오차가 평균 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].

5. Prediction Interval

Prediction interval 은 RMSE interval 의 배율 1.96 을 t distribution 에서 구한 배율로 바꾼 구간이고, 다음 오차 하나가 그 안에 들 확률이 n 과 무관하게 $1 - \alpha$ 로 유지된다.

$$\mathrm{LSL},\ \mathrm{USL} = \mu_0 \mp k\,\mathrm{RMSE}, \qquad k = \sqrt{\frac{n}{\nu}}\; t_{\nu}\!\left(1 - \frac{\alpha}{2}\right) \hspace{19em} (9)$$

식 (9) 의 $\mu_0$ 는 식 (2) 와 같다. $k$ 는 담을 확률 $1 - \alpha$ 가 정하는 배율이며, $\sqrt{n/\nu}$ 는 RMSE 가 제곱합을 $\nu$ 가 아니라 n 으로 나눈 것을 바로잡는 보정 계수다. Parameter 를 추정하지 않아 $\nu = n$ 이면 그 보정 계수가 1 이 되어 $k = t_n(1 - \alpha/2)$ 로 줄고, $\alpha = 0.05$ 와 n = 28 에서 2.05 이며, 그 값이 Table 2 의 마지막 열이다. Parameter 를 p 개 추정했으면 $\nu = n - p$ 를 넣어 다시 구하며, n = 28 에 p = 2 이면 2.13 이다.

꼭지 4 의 RMSE interval 과는 쓰는 표준편차가 같고 배율만 다르다. RMSE interval 은 배율을 1.96 으로 고정해 담는 확률이 식 (7) 로 내려가고, prediction interval 은 식 (9) 의 $k$ 를 써서 그 확률을 $1 - \alpha$ 로 유지한다.

5.1 The Multiplier for 95 Percent

$\alpha = 0.05$ 에서 배율은 n 이 28 이면 2.05, 50 이면 2.01, 100 이면 1.98 이다.

5.2 Leverage

이 문서의 prediction interval 은 leverage 를 뺀 간이 구간이며, 식 (9) 의 배율과 식 (8) 의 확률은 새 오차가 RMSE 를 구한 잔차와 독립이고 분산이 $\sigma^2$ 인 경우의 값이다. 새 입력 $x^{\ast}$ 에서 model 의 예측값을 빼고 남는 오차는 분산이 $\sigma^2$ 이 아니라 $\sigma^2(1 + h)$ 이고, $h$ 는 그 입력의 leverage, 곧 예측값 자체가 흔들리는 몫이다. 선형 회귀라면 $h = 1/n + (x^{\ast} - \bar{x})^2 / \sum (x_i - \bar{x})^2$ 이다. $h$ 가 0 보다 크면 실제로 담는 확률은 식 (9) 의 구간에서 $1 - \alpha$ 보다, 1.96 배 구간에서 식 (8) 의 값보다 낮고, 자료의 중심에서 멀어질수록 더 낮다.

5.3 Conditions

  • 가정: 꼭지 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.

6. Confidence Interval

Confidence interval 은 오차 하나가 아니라 오차의 평균이 들어 있을 구간이고, 같은 자유도와 같은 표준편차를 쓰면 폭이 prediction interval 의 $1/\sqrt{n}$ 이다.

구간은 $\bar{e} \pm t_{\nu}(1 - \alpha/2), s / \sqrt{n}$ 이며, $\bar{e}$ 는 오차 n 개의 평균, $s$ 는 그 평균을 뺀 뒤 구한 표준편차, 자유도는 $\nu = n - 1$ 이다. 담는 대상이 평균이므로 n 이 커지면 폭이 0 으로 줄지만, prediction interval 의 폭은 $\sigma$ 가 남아 0 으로 줄지 않는다. 둘을 바꾸어 쓰면 오차 하나를 담아야 할 때 $\sqrt{n}$ 배 좁은 구간을 긋게 된다.

Model 의 치우침이 0 인지 보는 데 이 구간을 쓴다. 구간이 0 을 담지 않으면 오차의 평균이 0 이 아니라는 뜻이고, 그 치우침은 꼭지 8.2 의 첫 항목대로 먼저 뺀다.

7. Tolerance Interval

Tolerance interval 은 모집단의 비율 $P$ 를 담는다는 것을 신뢰수준 $\gamma$ 로 보장하는 구간이다.

Prediction interval 에서는 다음 오차 하나가 들어올 확률이 평균적으로 $1 - \alpha$ 이고, tolerance interval 에서는 구간이 모집단의 $P$ 이상을 담을 확률이 $\gamma$ 이다. 신뢰수준을 0.5 보다 높게 둔 경우 요구가 하나 늘어난 만큼 배율도 커서, 같은 n 과 같은 비율에서 prediction interval 보다 넓다. 배율은 $P$ 와 $\gamma$ 와 n 으로 정해지는 tolerance factor 이고, 닫힌 형태가 없어 조합마다 표에서 읽는다 [1] [2].

"신뢰수준 95% 로 모집단의 99% 이상" 처럼 구간이 모집단의 몇 할을 담아야 하는지와 그것을 얼마의 신뢰수준으로 보장해야 하는지를 함께 요구할 때 쓴다. 다음 한 점이 구간에 드는지만 볼 때는 prediction interval 이 맞다.

8. Spec Setting for SPC

예측값으로 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 로 바꾼다.

8.1 What the Limit Is Drawn On

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 $k,\mathrm{RMSE}$ 한 예측의 오차를 받아들일지
2 Acceptance limit Spec 과 RMSE $g,\mathrm{RMSE}$ 예측값으로 규격 판정을 내릴지
3 Control limit 공정의 변동 관측 표준편차의 3 배 공정이 평소와 달라졌는지

1 행은 model 이 계측을 대신해도 되는 범위다. 2 행은 이미 있는 spec 을 안쪽으로 좁힌 한계이며, 좁힌 폭이 guard band 다. 3 행의 한계는 spec 에서 나오지 않지만, 예측값으로 chart 를 그리면 그 폭에 식 (11) 대로 RMSE 가 더해진다.

8.2 The Limit from the RMSE

Table 3 의 1 행인 error limit 은 꼭지 5 의 식 (9) 에 $\mu_0 = 0$ 을 넣은 것이다. Spec 은 요구에서 따로 정해지며, RMSE 는 꼭지 8.3 의 guard band 로만 spec 에 들어간다. $\alpha = 0.05$ 와 $\nu = n = 28$ 이면 배율이 2.05 이고, Table 2 의 마지막 열이 그 값이다. 쓰기 전에 아래 세 가지를 확인한다.

  • 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 에서 바꾸어 읽는다.

8.3 The Guard Band

예측값이 계측값을 대신해 규격 판정을 내리면 spec 을 안쪽으로 좁힌 수락 한계 (acceptance limit) 를 쓴다.

$$A_{\mathrm{L}} = \mathrm{LSL} + g\,\mathrm{RMSE}, \qquad A_{\mathrm{U}} = \mathrm{USL} - g\,\mathrm{RMSE} \hspace{19em} (10)$$

식 (10) 의 두 값 사이에 들어온 것만 받아들이고, spec 과 수락 한계 사이의 폭 $g,\mathrm{RMSE}$ 가 guard band 다. Spec 바로 안쪽에서 측정된 것도 참값은 밖에 있을 수 있고, 그 확률은 RMSE 가 클수록 커진다. Guard band 가 그 확률, 곧 consumer's risk 를 내린다 [5]. ISO 14253-1 의 기본 규칙은 확장 불확도 한 배를 spec 에서 빼는 것이다 [6]. RMSE 를 표준불확도로 보면 $g$ 가 곧 포함인자 (coverage factor) 이고, 관례인 포함인자 2 가 $g = 2$ 를 준다. n 이 작으면 식 (9) 의 $k$ 가 커지는 것과 같은 이유로 2 보다 큰 값을 쓴다. $g$ 를 키우면 consumer's risk 가 내려가는 대신 규격 안의 것을 거부할 확률, 곧 producer's risk 가 올라간다.

8.4 The Spec and the Control Limit

관리 한계는 공정의 변동에서 구하고 spec 은 요구에서 구하므로, 둘을 같은 수로 두지 않는다. 예측값으로 chart 를 그리면 관측되는 변동에 공정의 변동과 model 의 오차가 함께 들어 있다.

$$\sigma_{\mathrm{obs}}^2 = \sigma_{\mathrm{proc}}^2 + \mathrm{RMSE}^2 \hspace{19em} (11)$$

식 (11) 의 $\sigma_{\mathrm{obs}}$ 가 관리 한계의 폭을 정하므로, RMSE 가 공정 표준편차의 절반이면 한계가 1.12 배 넓어지고 같은 자료로 잰 공정능력지수 (process capability index) 는 0.89 배로 내려간다. RMSE 가 공정 표준편차와 같으면 각각 1.41 배와 0.71 배다. 식 (11) 은 model 의 오차가 공정의 변동과 독립일 때 성립하며, 오차가 공정 수준에 따라 달라지면 (heteroscedasticity) 하나의 RMSE 로 모든 공정 수준의 한계를 정하지 못한다.

References

[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.


Appendix A. Terminology

  • 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: 기댓값이 추정 대상과 같은 추정량.

Appendix B. Quantile Functions of the Normal and t Distributions

B.1 Normal Distribution

From the Cumulative Distribution Function to Its Inverse

누적분포함수는 값 $x$ 에 대해 그 이하일 확률을 주고, 분위수 함수는 반대로 확률 $q$ 에 대해 누적확률이 $q$ 가 되는 값을 준다. 표준정규분포의 누적분포함수는 $\Phi$ 로 적는다.

$$\Phi(x) = P(Z \le x), \qquad Z \sim N(0, 1) \hspace{19em} (12)$$

식 (12) 의 $\Phi$ 는 연속이고 $x$ 가 커지면 늘기만 하므로, 0 과 1 사이의 확률 $q$ 마다 $\Phi(x) = q$ 를 만족하는 $x$ 가 하나로 정해진다. 그 $x$ 를 $z(q)$ 로 적으며, 이것이 $\Phi$ 의 역함수다.

$$z(q) = \Phi^{-1}(q), \qquad \Phi(z(q)) = q \hspace{19em} (13)$$

$z(0.5)$ 는 0 이고 $z(0.975)$ 는 1.96 이다. 앞엣것은 중앙값이고, 뒤엣것은 그 아래에 전체의 97.5% 가 놓이는 지점이다.

The Two-sided Point

양쪽 꼬리에 합쳐 $\alpha$ 를 남기는 구간의 두 끝이 $\pm z(1 - \alpha/2)$ 다. 분포가 대칭이므로 한쪽 꼬리에 $\alpha/2$ 씩 남기고, 위쪽 꼬리가 $\alpha/2$ 인 지점은 그 아래의 누적확률이 $1 - \alpha/2$ 인 지점이다.

$$P\left(|Z| \le z(1 - \alpha/2)\right) = 1 - \alpha \hspace{19em} (14)$$

$\alpha = 0.05$ 를 넣으면 $z(0.975) = 1.96$ 이고, 식 (14) 이 식 (3) 이 된다.

B.2 t Distribution

자유도 $\nu$ 의 Student t distribution 도 같은 방식으로 $t(\nu, q)$ 를 쓴다. 그 분포의 누적분포함수 $F_{t_{\nu}}$ 의 역함수이며, $t(\nu, 1 - \alpha/2)$ 가 양쪽 꼬리에 합쳐 $\alpha$ 를 남기는 지점이다. t distribution 은 정규분포보다 꼬리가 두꺼워 같은 $q$ 에서 $z(q)$ 보다 크고, $\nu$ 가 커지면 $z(q)$ 로 다가간다. $\alpha = 0.05$ 에서 $t(28, 0.975)$ 는 2.05, $t(1000, 0.975)$ 는 1.96 이다.

Appendix C. Chi-squared Distribution

C.1 Definition

서로 독립이고 표준정규분포 $N(0, 1)$ 를 따르는 $k$ 개의 확률변수 $Z_1, Z_2, \dots, Z_k$ 가 있을 때, 이 변수들의 제곱합으로 정의되는 확률변수 $X$ 는 자유도가 $k$ 인 chi-squared distribution 을 따른다.

$$X = \sum_{i=1}^{k} Z_i^2 = Z_1^2 + Z_2^2 + \dots + Z_k^2 \sim \chi^2(k) \hspace{19em} (15)$$
  • $k$ (자유도, degrees of freedom): 합산되는 독립 표준정규분포 변수의 개수.

본문에서는 같은 자유도를 n 과 $\nu$ 로 적는다. 식 (20) 의 $S$ 는 식 (15) 의 $X$ 에 $k = n$ 을 넣은 것이고, 식 (23) 의 $S_{\nu}$ 는 $k = \nu$ 를 넣은 것이다.

C.2 Probability Density Function

자유도가 $k$ 인 chi-squared distribution 의 확률밀도함수 (probability density function) 는 $x \gt 0$ 에서 아래이다.

$$f(x; k) = \frac{1}{2^{k/2}\,\Gamma(k/2)}\; x^{(k/2) - 1}\, e^{-x/2} \hspace{19em} (16)$$

식 (16) 의 $\Gamma$ 는 gamma function 이며, 식 (19) 이 gamma function 의 정의다.

C.3 Cumulative Distribution Function

누적분포함수 $F(x; k)$ 는 확률변수 $X$ 가 특정 값 $x$ 이하일 확률 $P(X \le x)$ 를 뜻하며, 확률밀도함수를 0 부터 $x$ 까지 적분하여 구한다.

$$F(x; k) = P(X \le x) = \frac{1}{\Gamma(k/2)}\; \gamma\!\left(\frac{k}{2}, \frac{x}{2}\right) \quad (x \ge 0) \hspace{19em} (17)$$

식 (17) 의 $\gamma(s, t)$ 는 하부 불완전 감마 함수 (lower incomplete gamma function) 이고, $\Gamma(s)$ 는 적분의 위끝을 무한대로 늘린 gamma function 이다.

$$\gamma(s, t) = \int_0^t u^{s-1} e^{-u}\, du \hspace{19em} (18)$$ $$\Gamma(s) = \int_0^{\infty} u^{s-1} e^{-u}\, du \hspace{19em} (19)$$

Chi-squared distribution 의 누적분포함수는 닫힌 형태 (elementary function) 로 단순하게 표현되지 않는다. 그래서 식 (17) 처럼 정규화 불완전 감마 함수 (regularized incomplete gamma function) 의 꼴로 정의하고, 실제 계산에는 numerical 방법이나 R, Python, Excel 이 담은 통계 함수를 쓴다.

C.4 Properties

  • Range: $X \ge 0$. 제곱합이므로 음수가 되지 않는다.
  • Mean: $E(X) = k$.
  • Variance: $\mathrm{Var}(X) = 2k$.
  • Shape: $k$ 가 작을수록 오른쪽으로 긴 꼬리를 가진 비대칭 형태이며, $k$ 가 커질수록 점점 정규분포 모양에 가깝게 대칭형으로 변한다.

Appendix D. Derivation of Equations (4) to (8)

출발점은 오차 하나를 $\sigma$ 로 나눈 값이 표준정규분포를 따른다는 것 하나다. n 개를 제곱해 더하면 자유도 n 의 chi-squared distribution 이 된다.

$$S = \sum_{i=1}^{n} \left(\frac{e_i}{\sigma}\right)^2 \sim \chi^2_n, \qquad S = \frac{n\,\mathrm{RMSE}^2}{\sigma^2} \hspace{19em} (20)$$

두 번째 등식은 식 (1) 의 양변을 제곱해 n 을 곱한 것이며, 이것이 식 (4) 다. 식 (5) 는 여기서 제곱근의 기댓값으로 나온다. 자유도 n 의 chi-squared 값에 제곱근을 취한 값의 기댓값이 아래이다.

$$E\left[\sqrt{S}\right] = \sqrt{2}\;\frac{\Gamma\!\left(\frac{n+1}{2}\right)}{\Gamma\!\left(\frac{n}{2}\right)} \hspace{19em} (21)$$

식 (20) 에서 $\mathrm{RMSE} = \sigma\sqrt{S/n}$ 이므로 양변에 기댓값을 취하고 식 (21) 을 넣으면 식 (5) 의 $c_n$ 이 그대로 나온다.

식 (6) 은 t distribution 의 정의에서 나온다. 새 오차 $e^{\ast}$ 는 $e_1, \dots, e_n$ 과 독립이므로 $Z = e^{\ast}/\sigma$ 는 S 와 독립인 표준정규분포 값이다.

$$\frac{e^{\ast}}{\mathrm{RMSE}} = \frac{\sigma Z}{\sigma\sqrt{S/n}} = \frac{Z}{\sqrt{S/n}} \sim t_n \hspace{19em} (22)$$

식 (22) 의 가운데에서 $\sigma$ 가 약분되므로 담는 비율은 모르는 $\sigma$ 와 무관해지고 n 하나로 정해진다. 좌변의 절댓값이 1.96 이하일 확률을 t distribution 의 누적분포함수로 적은 것이 식 (7) 이다.

Parameter 를 p 개 추정한 경우에는 제곱합의 자유도가 $\nu = n - p$ 로 줄지만, RMSE 는 식 (1) 대로 n 으로 나눈다. 자유도만큼의 chi-squared 값을 $S_{\nu}$ 로 두면 두 수가 따로 남는다.

$$\frac{e^{\ast}}{\mathrm{RMSE}} = \frac{Z}{\sqrt{S_{\nu}/n}} = \sqrt{\frac{n}{\nu}}\;\frac{Z}{\sqrt{S_{\nu}/\nu}} \sim \sqrt{\frac{n}{\nu}}\;t_{\nu} \hspace{19em} (23)$$

식 (23) 의 좌변이 1.96 이하일 조건은 $t_{\nu}$ 가 $1.96\sqrt{\nu/n}$ 이하일 조건과 같고, 이것을 누적분포함수로 적은 것이 식 (8) 이다. 식 (5) 의 $c_n$ 도 n 을 $\nu$ 로 바꾸면 $\sqrt{\nu/n}$ 배만큼 더 작아진다.

Our Score
Click to rate this post!
[Total: 0 Average: 0]
Visited 37 times, 1 visit(s) today

Leave a Comment

Your email address will not be published. Required fields are marked *