# A Modified Bayesian Network Model to Predict Reorder Level of Printed Circuit Board
## 3 Modified Bayesian Network Model Development
### Bayesian Network
```
(1) Compute the \(\text{CMI}(x_{i};x_{j}|\text{Rel})\) between \(x_{i}\) and \(x_{j}\) according to Equation (4); (2) Select input variables \(x_{k1},\ldots,x_{kt}\) with \(\text{CMI}(x_{i};x_{j}|\text{Rel})\) being greater than a threshold, and manually link \(x_{i}\) to \(x_{k1},\ldots,x_{kt}\) with directed arcs if there are no arcs between the two nodes; (3) Combining CMI by expert experience to determine the variables that links to Rel with directed arcs; (4) Compute LSP according to Equation (5) for each link to evaluate the quality of BN structure and modified (deleted) arrows with small LSP, e.g., 10%. ```  
**Algorithm 3**Modified BN structure establishment. The Bayesian estimation method was employed for parameter learning in this paper to estimate \(\theta=\text{max}p(\theta|X)\) based on the training samples. Initially, \(\theta\) was treated as a random variable and prior knowledge of \(\theta\) is expressed as a prior probability distribution \(p(\theta)\). Furthermore, there is a likelihood that the function was utilized based on samples. Subsequently, the Bayesian formula was taken to determine the posterior probability distribution of \(\theta\). Dirichlet distribution was employed as the prior probability distribution of \(p(\theta)\)[16]. CMI between \(x_{i}\) and \(x_{j}\) for the training samples based on Equation (4) is given in Table 5. The threshold was set as 10% and CMI equal to or greater than 10% was reserved to construct the link. It can be seen that (1) CMI is small between layer number, recency, and \(F1\)-\(F7\), which can be taken as independent variables while constructing BN structure. (2) CMI is large between \(F3\), \(F4\), \(F6\), and \(F7\), which means that the cumulative delivery scale (\(F1\)) of repeated orders is not independent of \(\text{mean}/\text{min}/\text{max}\) statistic results of delivery quantity, area, transaction money (\(F3\), \(F6\), and \(F4\)), and frequency (\(F7\)). (3) Similarly, \(F6\) (mean/min/max delivery area) has great mutual information between \(F3\) (mean/min/max delivery quantity) and \(F4\) (mean/min/max transaction money). On this basis, the structure of modified BN with entropy in each node and LSP for each link was constructed according to Algorithm 3, which was given in Figure 5. Entropy in each node reflects the purity of the node and they were computed based on \(Ent(x)=-\sum_{x_{i}}P(x_{i})\log_{2}P(x_{i})\) where \(x_{i}\) is the discretized value set of node \(x\), which indicates how much uncertainty is in \(x\) if no evidence is given for any other nodes. LSP was computed based on Equation (5) and it can be seen that the LSP for links from \(Ln\), \(Rec\), \(F1\), \(F2\), \(F5\), and \(F7\) to \(Rel\) are large, which means that these variables can help reduce the high percentage of uncertainty for _Rel_ when knowing the state of these nodes. Similarly, LSP of links from _F2_, _F3_, _F6_, and _F7_ to _F1_ are large, which indicates that _F2_, _F3_, _F6_, and _F7_ have a close causal relationship with _F1_. However, weak LSP of links from _F7_ to _F2_ and _F4_ to _F6_ marked with dotted lines are less than 10% and, therefore, the directed arcs from _F7_ to _F2_ and _F4_ to _F6_ were deleted accordingly. Then parameter learning was conducted based on the training samples and the structure to determine the CPTs for each node.