# A Modified Bayesian Network Model to Predict Reorder Level of Printed Circuit Board
## 4 Model Evaluation
### Experimental Results  
Reorder frequency of the samples six months after a set date can be taken as a random event for a manufacturer without prior knowledge and the models are expected to have errors in prediction. It is necessary for finding an upper limit and a lower limit to make as many as possible observed values lie in. Additionally, the small field data set may cause uncertain deviations between observed reorder levels and predicted ones. It is also impractical to fit the reorder frequency in a specific distribution absolutely. The counting nature of the reorder frequency makes it intuitive for using a Poisson distribution as the probability distribution function (PDF). Therefore, assuming the reorder frequency in each reorder level following a Poisson distribution is justifiable since it has a high repetition occurrence rate and more numbers under low reorder levels and a small probability at high reorder levels, which is shown in Table 2. The approximate upper limit for 95% confidence aligns with the Poisson cumulative distribution function (CDF) and is equal to or greater than 95%. The lower limits are considered to be zero because of the nonnegative counting property of Poisson distribution [14]. Monte Carlo simulation is used to weaken the influence of uncertainty factors in this research. It is an effective method for quantifying the variance resulting from the random nature of repetition events. For any sample (orders with the same production number) with a given cluster and the distribution of the reorder frequency, a random number can be generated through simulation to present the reorder frequency for this sample and the 95% confidence upper limit can be obtained. As a result, it is used to estimate reorder frequency and the 95% upper limit for each sample. Along with the increase in the \begin{table}
\begin{tabular}{c c} \hline
**Terminology** & **Description** \\ \hline True positive (TP) & Number of correctly predicted instances for each column \\ False negative (FN) & Number of incorrectly predicted instances for each column \\ False positive (FP) & Number of incorrectly predicted instances for each row \\ True negative (TN) & Number of correctly predicted instances for each row \\ Sensitivity or true positive rate (TPR) & TP/(TP+FN) \\ False negative rate (FNR) & 1-TPR \\ Specificity or true negative rate (TNR) & TN/(TN+FP) \\ False positive rate (FPR) & 1-TNR \\ Positive predictive value (PPV) & TP/(TP+FP) \\ False discovery rate (FDR) & 1-PPV \\ Accuracy (ACC) & (TP+TN)/Total instances \\ \hline \end{tabular}
\end{table} 
Table 9: Terminology and derivations of the confusion matrix. number of simulations, the prediction accuracy will increase gradually. Therefore, it can quantify the variance resulting from the randomness of repetition events. A procedure of Monte Carlo simulation is described below (Algorithm 5). ```
1 Given a specific order, determine the cluster of the sample;
2 Determine the expected reorder frequency (within six months after a set date) as the parameter (lamda) of Poisson PDF and CDF for the sample according to Equation (9) based on Tables 7 and 8;
3 Generate \(n\) (10,000 here) random number by Poisson PDF with lamda as its expectation and take the average result of the \(n\) random number as the simulated reorder frequency;
4 Determine the least integer for Poisson CDF being greater than 0.95 as the 95% upper limit of reorder frequency for the order. ```  
**Algorithm 5**Monte Carlo simulation of reorder times. A total of 250 randomly selected samples with Monte Carlo simulation results obtained by Algorithm 5 are presented in Figure 8. The performance of the Bayesian network for training and test data can be seen from Figure 8a,b, respectively. When the reorder level is low, the estimated value is close to the observed one. In some extreme situations, it can cause a greater reorder frequency than what can be predicted. The presentation in figures is that the observed values are higher than the 95% upper limits.