Markov random fields use an undirected graph to model dependences over a probability distribution. For each clique in its graph, ๐Ÿช Factor measures the degree of dependence between variables in the clique; specifically, given a configuration of values for the variables, returns a high value if itโ€™s probable.

Using factors, we construct a probability distribution

where is the set of cliques and is the partition function

that ensures the distribution is valid.

This form of the graphical model is extremely general. In fact, a ๐Ÿšจ Bayesian Network can be represented in this form using the transformation (called moralization) below.

Independence

Two variables are dependent if theyโ€™re connected by a path of unobserved variables. Thus, independence is achieved when the variables are separated by a โ€œwallโ€ of observed variables.

The Markov blanket for is defined as the minimal set of nodes that, if observed, makes independent from the rest of the graph. The blanket here is simply the neighborhood of .

Factor Graphs

Another way to visualize Markov random fields is with factor graphs, with explicitly separates factors from the random variables. This makes the computation and dependencies clearer.