## 4 Method for Optimizing Measurement Uncertainty
### Real-Time Updating of Repeatability Uncertainty Component  
The method of calculating uncertainty by means of statistical analysis based on experimental data is called the type A evaluation method [32]. The uncertainty components introduced by repeatability are usually obtained by experimental pre-evaluation and determined only by one experiment, so the information contained in the results is limited and poor in representativeness; moreover, the working states of instruments and workpiece may change with time during the experiment, so the uncertainty component determined by one evaluation experiment cannot reflect the latest information in the evaluation process. If the uncertainty component caused by repeatability is not changed after evaluation, the evaluation results of the uncertainty will not sufficiently reflect the latest information in the process of measurement. For the measurement of the same batch of workpieces with the same machining accuracy, the cost is rather high for repetitive experiments of each workpiece respectively, so it is impossible to carry out a large number of uncertainty evaluation experiments at any time for batch products. If the uncertainty components caused by repeatability can be updated continuously in real time based on daily measurement data, then the current and historical information can be fully integrated into the uncertainty evaluation results and the latest status of the CMM same or similar measurement tasks can be reflected in real time. Therefore, this paper has proposed using the Bayesian information fusion method to establish an information fusion model based on Bayesian formula and to achieve real-time and continuous updates of uncertainty components, so that the evaluation results of task-oriented CMM measurement uncertainty could reflect the latest information in the measurement system in real time, and improve the reliability of the uncertainty evaluation results. The repeated measurements generally obey normal distribution and the prior distribution is identical to the posterior distribution in form during the process of information fusion. Therefore, the conjugate Bayesian method can be used to update the uncertainty components of repeatability continuously. Set the measurement series of repetitive experiments as \(X=(x_{1},x_{2},x_{3},\cdots,x_{n})\) and \(X\sim N(\theta,\sigma^{2})\). Then the Bessel formula can be used to work out the standard uncertainty component of repeatability in a single result:  
\[u=\sqrt{\frac{\sum\limits_{i=1}^{n}(x_{i}-\overline{x})^{2}}{n(n-1)}} \tag{18}\]  
If the number of measurements in the first repeatability experiment is \(n_{0}\) and the measurement result is \(X=(x_{01},x_{02},x_{03},\cdots,x_{0n})\), according to the evaluation method of conjugate Bayesian uncertainty, the conjugate prior distribution of \(\sigma^{2}\) is as follows:  
\[\pi(\sigma^{2})=\frac{\sqrt{S_{0}^{n_{0}-1}}}{\sqrt{2^{n_{0}-1}}\Gamma(\frac{ n_{0}-1}{2})}(\frac{1}{\sigma^{2}})^{\frac{n_{0}+1}{2}}\exp(-\frac{S_{0}}{2 \sigma^{2}})\propto(\frac{1}{\sigma^{2}})^{\frac{n_{0}+1}{2}}\exp(-\frac{S_{0 }}{2\sigma^{2}}) \tag{19}\]where, \(S_{0}=\sum\limits_{j=1}^{n}{(x_{0j}-\overline{x}_{0})^{2}}\). Therefore, the uncertainty component of the first repeatability experiment is:  
\[u_{0}=\sqrt{\frac{S_{0}}{n_{0}-1}} \tag{20}\]  
Assuming that the number of measurements in the second repeatability experiment is \(n_{1}\) and the measurement result is \(X=(x_{11},x_{12},x_{13},\cdots,x_{1n})\), use the latest repeatability data to update \(\sigma^{2}\) and its likelihood function is as follows:  
\[l(\sigma^{2}|x)\propto(\frac{1}{\sigma^{2}})^{\frac{n_{1}}{2}}\exp(-\frac{S_{ 1}}{2\sigma^{2}}) \tag{21}\]  
where, \(S_{1}=\sum\limits_{j=1}^{n}{(x_{1j}-\overline{x}_{1})^{2}}\).