# Hard and Soft EM in Bayesian Network Learning from Incomplete Data
## 3 Materials  
In order to address the question above, we perform a simulation study to compare soft and hard EMs. We limit ourselves to discrete BNs, for which we explore both parameter learning (using a fixed gold-standard network structure) and structure learning (using network structures with high \(\mathrm{P}(\mathcal{G}\mid\mathcal{D})\) that would be likely candidate BNs during learning). In addition, we consider a variant of soft EM in which we use early stopping to match its running time with that of hard EM. We will call it _soft-forced EM_, meaning that we force it to stop without waiting for it to converge. In particular, _soft-forced EM_ stops after 3, 4 and 6 iterations, respectively, for _small_, _medium_ and _large_ networks. The study investigates the following experimental factors:  
* Network size: small (from 2 to 20 nodes), medium (from 21 to 50 nodes) and large (more than 50 nodes). * Missingness balancing: whether the distribution of the missing values over the possible values taken by a node is balanced or unbalanced (that is, some values are missing more often than others). * Missingness severity: low (\(\leqslant\)1% missing values), medium (1% to 5% missing values) and high (5% to 20% missing values). * Missingness pattern: whether missing values appear only in root nodes (labelled \"root\"), only in leaf nodes (\"leaf\"), in nodes with large number of neighbours (\"high degree\") or uniformly on all node types (\"fair\"). We also consider specific target nodes that represent the variables of interest in the BN (\"target\"). * Missing data mechanism: the _ampute_ function of the **mice** R package [27] has been applied to generated data sets to simulate MCAR, MAR and MNAR missing data mechanisms as described in Section 2.2. We recognise that these are but a small selection of the characteristics of the data and of the missingness patterns that might determine differences in the behaviour of soft EM and hard EM. We focus on these particular experimental factors because either they can be empirically verified from data, or they must be assumed in order to learn any probabilistic model at all, and therefore provide a good foundation for making practical recommendations for real-world data analyses. The simulation study is based on seven reference BNs from _The Bayesys data and Bayesian network repository_[28], which are summarised in Table 1. We generate incomplete data from each of them as follows:  
1. We generate a complete data set from the BN. 2. We introduce missing values in the data from step 1 by hiding a random selection of observed values in a pattern that satisfies the relevant experimental factors (missingness balancing, missingness severity, missingness pattern and missing data mechanism). We perform this step 10 times for each complete data set. 3. We check that the proportion of missing values in each incomplete data set from step 2 is within a factor of 0.01 of the missingness severity. 4. We perform parameter learning with each EM algorithm and each incomplete data set to estimate the \(\widehat{\Theta}_{i}\) for each node \(X_{i}\), which we then use to impute the missing values in those same data sets. As for the network structure, we consider both the DAG of the reference BN and a set network structures with high \(\mathrm{P}(\mathcal{G}\,|\,\mathcal{D})\). The complete list of simulation scenarios is included Appendix A. We measure the performance of the EM algorithms with:  
* The _proportion of correct replacements_ (PCR), defined as the number of missing values that are correctly replaced. Higher values are better. * The _absolute probability difference_: \[\mathrm{APD}=\sum_{m=1}^{M}|p_{m}-q_{m}|,\] (7)