the evidence is very unlikely, there is a large difference between Pr(X) and the optimal importance function. Effectively, most samples are discarded and the performance of logic sampling deteriorates badly.

Likelihood weighting (LW) (Fung & Chang, 1989; Shachter & Peot, 1989) enhances the logic sampling in that it never discards samples. In likelihood weighting, the importance function in Step 2 is

$$\mathrm{Pr}(\mathbf{X}\backslash\mathbf{E})=\prod_{x_{i}\not\in\mathbf{e}}\mathrm{Pr}(x_{i}|\mathrm{Pa}(X_{i}))\Bigg|_{\mathbf{E}=\mathbf{e}}.$$

Likelihood weighting does not update the importance function in Step 7. Although likelihood weighting is an improvement on logic sampling, its convergence rate can be still very slow when there is large difference between the optimal importance function and Pr(X\E),
again especially in situations when evidence is very unlikely. Because of its simplicity, the likelihood weighting algorithm has been the most commonly used simulation method for Bayesian network inference. It often matches the performance of other, more sophisticated schemes because it is simple and able to increase its precision by generating more samples than other algorithms in the same amount of time.

Backward sampling (Fung & del Favero, 1994) changes Step 1 of our generic algorithm and allows for generating samples from evidence nodes in the direction that is opposite to the topological order of nodes in the network. In Step 2, backward sampling uses the likelihood of some of the observed evidence and some instantiated nodes to calculate Pr 0 (X\E).

Although Fung and del Favero mentioned the possibility of dynamic node ordering, they did not propose any scheme for updating the importance function in Step 7.  Backward sampling suffers from problems that are similar to those of likelihood weighting, i.e., a possible mismatch between its importance function and the optimal importance function can lead to poor convergence.

Importance sampling (Shachter & Peot, 1989) is the same as our generic sampling algorithm. Shachter and Peot introduced two variants of importance sampling: self-importance
(SIS) and heuristic importance. The importance function used in the first step of the self-importance algorithm is

$$\mathrm{Pr}^{0}(\mathbf{X}\backslash\mathbf{E})=\prod_{x_{i}\notin\mathbf{e}}\mathrm{Pr}\left(x_{i}|\mathrm{Pa}\big(X_{i}\big)\right)\Bigg\vert_{\mathbf{E}=\mathbf{e}}.$$

This function is updated in Step 7. The algorithm tries to revise the conditional probability tables (CPTs) periodically in order to make the sampling distribution gradually approach the posterior distribution. Since the same data are used to update the importance function and to compute the estimator, this process introduces bias in the estimator. Heuristic importance first removes edges from the network until it becomes a polytree, and then uses a modified version of the polytree algorithm (Pearl, 1986) to compute the likelihood functions for ea of the unobserved nodes. Pr 0 (X\E) is a combination of these likelihood functions with Pr(X\E,e). In Step 7 heuristic importance does not update Prk(X\E). As Shater and Peot (1989) point out, this heuristic importance function can still lead to a bad approximation of the optimal importance function. There exist also other algorithms such as a combination of self-importance and heuristic importance (Shachter & Peot, 1989;