## 3 Common Distributional Assumptions for Bayesian Networks
### Gaussian BNs
The computational complexity of composing the global distribution is bound by the matrix multiplication \(C_{\mathcal{B}}C_{\mathcal{B}}^{\mathrm{T}}\), which is \(O\big{(}N^{3}\big{)}\); if we assume that \(\mathcal{G}\) is sparse as in [PERSON] et al. [29], the number of arcs is bound by some \(cN\), computing the \(\boldsymbol{\mu}_{\mathcal{B}}\) takes \(O(N)\) operations. The complexity of decomposing the global distribution is also \(O\big{(}N^{3}\big{)}\) because both inverting \(C_{\mathcal{B}}\) and multiplying the result by \(\mathrm{diag}(C_{\mathcal{B}})\) are \(O\big{(}N^{3}\big{)}\). **Example 2** (Composing and decomposing a GBN). : _Consider the GBN \(\mathcal{B}\) from Figure 1 top. The topological ordering of the variables defined by \(\mathcal{B}\) is \(\{\{X_{1},X_{2}\},X_{4},X_{3}\}\), so_  
\[C_{\mathcal{B}}= \begin{array}{c}X_{1}\\ X_{2}\\ X_{4}\\ X_{3}\\ \end{array}\begin{pmatrix}0.894&0&0&0\\ 0&0.774&0&0\\ 1.341&2.014&1.049&0\\ 1.610&2.416&1.258&0.948\\ \end{pmatrix} \]  
_where the diagonal elements are_  
\[C_{\mathcal{B}}[X_{1};X_{1}]=\sqrt{0.8},\quad C_{\mathcal{B}}[X_{2};X_{2}]= \sqrt{0.6},\quad C_{\mathcal{B}}[X_{4};X_{4}]=\sqrt{1.1},\quad C_{\mathcal{B}} [X_{3};X_{3}]=\sqrt{0.9};\]  
_and the elements below the diagonal are taken from the corresponding cells of_  
\[C_{\mathcal{B}}[X_{4};\,\cdot\,]= \begin{pmatrix}1.5&2.6\\ 0&0.774&0&0\\ \end{pmatrix} ,\] \[C_{\mathcal{B}}[X_{3};\,\cdot\,]= \begin{pmatrix}1.2\\ 1.341&2.014&1.049&0\\ \end{pmatrix} .\]  
_Computing \(C_{\mathcal{B}}C_{\mathcal{B}}^{\mathrm{T}}\) gives_  
\[\widetilde{\Sigma}_{\mathcal{B}}= \begin{array}{c}X_{1}\\ X_{1}\\ X_{2}\\ X_{4}\\ X_{3}\\ \end{array}\begin{pmatrix}0.800&0&1.200&1.440\\ 0&0.600&1.560&1.872\\ 1.440&1.872&8.347&10.916\\ \end{pmatrix} \]  
_and reordering the rows and columns of \(\widetilde{\Sigma}_{\mathcal{B}}\) gives_  
\[\Sigma_{\mathcal{B}}= \begin{array}{c}X_{1}\\ X_{2}\\ X_{3}\\ X_{4}\\ \end{array}\begin{pmatrix}0.800&0&1.440&1.200\\ 0&0.600&1.872&1.560\\ 1.440&1.872&10.916&8.347\\ 1.200&1.560&8.347&6.956\\ \end{pmatrix} .\]  
_The elements of the corresponding expectation vector \(\boldsymbol{\mu}_{\mathcal{B}}\) are then_  
\[\mathrm{E}(X_{1}) =2.400,\] \[\mathrm{E}(X_{2}) =1.800,\] \[\mathrm{E}(X_{4}) =0.2+1.5\,\mathrm{E}(X_{1})+2.6\,\mathrm{E}(X_{2})=8.480,\] \[\mathrm{E}(X_{3}) =2.1+1.2\,\mathrm{E}(X_{4})=12.276.\]  
_Starting from \(\Sigma_{\mathcal{B}}\), we can reorder its rows and columns to obtain \(\widetilde{\Sigma}_{\mathcal{B}}\). The Cholesky decomposition of \(\widetilde{\Sigma}_{\mathcal{B}}\) is \(C_{\mathcal{B}}\). Then_  
\[\sigma_{X_{1}}^{2} =C_{\mathcal{B}}[X_{1};X_{1}]^{2}=0.8, \sigma_{X_{2}}^{2}=C_{\mathcal{B}}[X_{2};X_{2}]^{2}=0.6,\] \[\sigma_{X_{3}}^{2} =C_{\mathcal{B}}[X_{3};X_{3}]^{2}=0.9, \sigma_{X_{4}}^{2}=C_{\mathcal{B}}[X_{4};X_{4}]^{2}=0.11.\]_The coefficients \(\mathbf{\beta}_{X_{i}}\) of the local distributions are available from_  
\[R=\mathrm{I}_{N}-\underbrace{ \begin{bmatrix}0.894&0&0&0\\ 0&0.774&0&0\\ 0&0&1.049&0\\ 0&0&0&0.948\end{bmatrix} }_{\text{diag}(C_{\mathcal{B}})}\underbrace{ \begin{bmatrix}1.118 &0&0&0\\ 0&1.291&0&0\\ -1.430&-2.479&0.953&0\\ 0&0&-1.265&1.054\end{bmatrix} }_{C_{\mathcal{B}}^{-1}}\] \[= \begin{array}{c}X_{1}\\ X_{2}\\ X_{4}\\ X_{3}\end{array}\begin{pmatrix}0&0&0&0\\ 0&0&0\\ 1.500&2.600&0\\ 0&0&1.200&0\end{pmatrix} \]  
_where we can read \(R_{X_{4},X_{1}}=1.5=\beta_{X_{4},X_{1}}\), \(R_{X_{4},X_{2}}=2.6=\beta_{X_{4},X_{2}}\), \(R_{X_{3},X_{4}}=1.2=\beta_{X_{3},X_{4}}\)._  
_We can read the standard errors of \(X_{1}\), \(X_{2}\), \(X_{3}\) and \(X_{4}\) directly from the diagonal elements of \(C_{\mathcal{B}}\), and we can compute the intercepts from \(\mathbf{\mu}_{\mathcal{B}}-R\mathbf{\mu}_{\mathcal{B}}\) which amounts to_  
\[\mu_{X_{1}} =\mathrm{E}(X_{1})=2.400,\] \[\mu_{X_{2}} =\mathrm{E}(X_{2})=1.800,\] \[\mu_{X_{4}} =\mathrm{E}(X_{4})-\mathrm{E}(X_{1})\beta_{X_{4},X_{1}}-\mathrm{ E}(X_{2})\beta_{X_{4},X_{2}}=0.200,\] \[\mu_{X_{3}} =\mathrm{E}(X_{3})-\mathrm{E}(X_{4})\beta_{X_{3},X_{4}}=2.100.\]