# Risk Assessment for Linear Regression Models in Metrology
## 2 Materials and Methods
### Model Parameters
#### 2.2.1 Best Estimate of a Measurand  
In assessing risk in regression models, the best estimates of a measurand \(y_{0}\) can be obtained by calculating the values for the regression line \(y_{f}\) in the points of the reference scale \(\mathbf{x}\). In that case, the best estimate of the measured quantity is represented by the vector \(\mathbf{y_{0}}=(y_{f}(x_{1}),y_{f}(x_{2}),\ldots,y_{f}(x_{13}))\), and the risk is estimated for each of the values of the regression line \(y_{f}=y_{f}(x_{i}),j=1,2,\ldots,13\). The coefficients \(\hat{\beta}_{0}\) (intercept) and \(\hat{\beta}_{1}\) (slope) of the regression line were obtained by the well-known least squares (LS) method from a simple linear regression model:  
\[y_{ij}=\beta_{0}+\beta_{1}x_{j}+\epsilon_{ij},i=1,2,3,j=1,2,\ldots,n_{2}, \tag{1}\]  
where the intercept \(\beta_{0}\) and slope \(\beta_{1}\) are the model parameters and \(n_{2}=13\). For simplicity, in the subsequent text, where appropriate, the designation \(n_{1}=3\) is utilized. The values \(\epsilon_{ij},i=1,2,3,j=1,2,\ldots,n_{2}\) are random errors [45; 46]. Model parameters \(\beta_{0}\) and \(\beta_{1}\) were estimated for each pair of observations \(\left(x_{i},y_{i,j}\right),i=1,2,3,j=1,2,\ldots,n_{2}\)[47] (pp. 76-78). The best estimates, \(\hat{\beta}_{0}\) and \(\hat{\beta}_{1}\), of the parameters \(\beta_{0}\) and \(\beta_{1}\) were obtained using the least square method by minimizing the sum of the squared residuals. According to [45; 48], it is not difficult to show the following:  
\[\hat{\beta}_{1}=\frac{\sum_{i=1}^{n_{1}}\sum_{j=1}^{n_{2}}x_{i}y_{i,j}-n\overline {x}\overline{y}}{n_{1}\sum_{j=1}^{n_{2}}x_{i}^{2}-n\overline{x}^{2}}, \tag{2}\]  
where is \(n=n_{1}\cdot n_{2}=39\), and that is:  
\[\hat{\beta}_{0}=\overline{y}-\hat{\beta}_{1}\overline{x}. \tag{3}\]  
The value of \(\overline{x}\) in expressions (2) and (3) represents the arithmetic mean of the values of the moderate scale:  
\[\overline{x}=\frac{1}{n_{2}}\sum_{j=1}^{n_{2}}x_{j}. \tag{4}\]  
It should be noticed that the values of the moderate scale are equidistant. Also, the values from the left side of zero on the moderate scale are of the opposite sign when compared to \begin{table}
\begin{tabular}{c c c c} \hline
**Reference Value** & **1 st Measurement** & **2 nd Measurement** & **3 rd Measurement** \\
**x/\(\mu\)m** & **y/\(\mu\)m** & **y/\(\mu\)m** & **y/\(\mu\)m** \\ \hline \(-15\) & \(-15.10\) & \(-15.00\) & \(-15.05\) \\ \(-10\) & \(-10.10\) & \(-10.00\) & \(-10.05\) \\ \(-5\) & \(-5.10\) & \(-5.05\) & \(-5.06\) \\ \(0\) & \(0.00\) & \(0.00\) & \(0.00\) \\ \(5\) & \(4.98\) & \(4.98\) & \(5.00\) \\ \(10\) & \(9.99\) & \(10.00\) & \(10.02\) \\ \(15\) & \(14.99\) & \(15.00\) & \(15.00\) \\ \(20\) & \(20.00\) & \(20.00\) & \(20.05\) \\ \(25\) & \(25.00\) & \(25.02\) & \(25.00\) \\ \(30\) & \(30.00\) & \(30.05\) & \(30.00\) \\ \hline \end{tabular}  
* Positive and negative reference values of the calibration scale indicate the direction of the probe movement during calibration.  
\end{table} 
Table 1: _Cont._the values from the right side of the moderate scale. That's why it's always worth that is \(\overline{\mathrm{x}}=0\). The value of \(\overline{\mathrm{y}}\) in equations (2) and (3) is calculated from:  
\[\overline{\mathrm{y}}=\frac{1}{n}\sum_{i=1}^{n_{1}}\sum_{j=1}^{n_{2}}Y_{ij}. \tag{5}\]  
To estimate the measurement uncertainty \(\mathrm{u}_{0}\) based on the law of propagation of uncertainty (LPU) applied to the functional relationship of the input data, which was obtained from the linear regression analysis, two additional quantities are crucial: the standard error of slope \(\mathrm{u}\big{(}\hat{\beta}_{1}\big{)}\) and the standard error of intercept \(\mathrm{u}\big{(}\hat{\beta}_{0}\big{)}\).