# How to compute the mean of a conditional linear gaussian distribution

In a bayes net context consider the following covariance matrix where G is the child node and D and E are continuous parents

           G         D         E
G 11.4038771 0.8944238 9.3671434
D  0.8944238 0.2937604 0.2322106
E  9.3671434 0.2322106 8.8262010


with

36.6174413683 #mean of G
[7.35806706, 15.06258672] #mean of D and E respectively


I know that the equation used is

μa|b = μa +Σab Σbb−1(xb −μb)


But I am just having some trouble to compute the conditional linear gaussian mean with more than one continuous parent, so please someone show how to compute it with some clear steps.

Notice: this is the clgaussian.test dataset from bnlearn R library.

• You can still use this equation μa|b = μa +Σaa Σab−1(xb −μb) even when you have more than one parent... – user30490 Sep 11 '15 at 15:40
• @ZERO clear steps please – m.awad Sep 11 '15 at 15:44
• Actually, that formula is incorrect. The correct one should read: µa|b = µa + ∑ab ∑bb-1 (xb - µb). – Vimal Sep 11 '15 at 15:48
• @Vimal I have edited my question with the correct formula..it was an honest typo I swear – m.awad Sep 11 '15 at 15:56

$\Sigma = \begin{bmatrix} \sigma_{dd} & \sigma_{de} & \sigma_{dg} \\ \sigma_{ed} & \ldots & \\ \sigma_{gd} & \ldots \end{bmatrix}$
$\mu_{G|D,E=(d,e)} = \mu_G + \begin{bmatrix} \sigma_{gd} & \sigma_{ge}\end{bmatrix} \begin{bmatrix} \sigma_{dd} & \sigma_{de} \\ \sigma_{ed} & \sigma_{ee}\end{bmatrix}^{-1} \begin{bmatrix} d - \mu_d \\ e - \mu_e\end{bmatrix}$