Inference on a factor graph (Sum-product Algorithm) I was going through the sum-product algorithm which can be used to find marginal distribution efficiently(and exactly) when the factor graph is a tree.
I found it difficult to understand the way they have expressed the joint probability density function eq 8.62 

I have gone through many sources and have failed to understand this.Can someone give an example and help me to understand why 8.62 holds? What does X(s) mean exactly?
 A: The assumption here is that the probability density $p(x)$ can be represented as a product of several factors that each only depend on a subset of the latent variables. To give a very simple example, consider
$p(x_1, x_2, x_3) = f_1(x_1, x_2) f_2(x_2, x_3) f_3(x_3)$
with the associated factor graph
x_1 --- |f_1| --- x_2 --- |f_2| --- x_3 --- |f_3|.

If we now want to find the marginal probability $p(x_2)$, we need to sum (in the case of discrete variables) or integrate (in the case of continuous variables) over all admissible values of the other latent variables:
$p(x_2) = \sum\limits_{x_1,x_3} p(x_1, x_2, x_3)$.
To do so, it is convenient to partition the factor graph into subtrees emerging from the variable node $x_2$. Here, we only have two subtrees; the left one containing only the factor $f_1$ and the right one, containing the factors $f_2$ and $f_3$.
To each subtree, we associate a function $F_s$ that is equal to the product of all factor nodes contained in that subtree, and a set $X_s$ that contains all variable nodes contained in that subtree.
Using these definitions for the present example yields
$p(x_1, x_2, x_3) = f_1(x_1, x_2) f_2(x_2, x_3) f_3(x_3) = \prod\limits_{i=1}^2 F_i(x_2, X_i)$,
with $X_1 = x_1$ and $X_2 = x_3$, and $F_1(x_2, X_1) = f_1(x_1, x_2)$ and $F_2(x_2, X_2) = f_2(x_2, x_3) f_3(x_3)$.

Just as a side note, I find the introduction to factor graphs by Hans-Andrea Loeliger very useful and accessible:
https://people.kth.se/~tjtkoski/factorgraphs.pdf
