In the domain of physics and probability, a Markov random field (MRF), Markov network or undirected graphical model is a set of random variables having a Markov property described by an undirected graph. In other words, a random field is said to be a Markov random field if it satisfies Markov properties. The concept originates from the Sherrington–Kirkpatrick model. A Markov network or MRF is similar to a Bayesian network in its representation of dependencies; the differences being that Bayesian networks are directed and acyclic, whereas Markov networks are undirected and may be cyclic. Thus, a Markov network can represent certain dependencies that a Bayesian network cannot (such as cyclic dependencies ); on the other hand, it can't represent certain dependencies that a Bayesian network can (such as induced dependencies ). The underlying graph of a Markov random field may be finite or infinite. When the joint probability density of the random variables is strictly positive, it is also referred to as a Gibbs random field, because, according to the Hammersley–Clifford theorem, it can then be represented by a Gibbs measure for an appropriate (locally defined) energy function. The prototypical Markov random field is the Ising model; indeed, the Markov random field was introduced as the general setting for the Ising model. In the domain of artificial intelligence, a Markov random field is used to model various low- to mid-level tasks in image processing and computer vision.
Definition Given an undirected graph G=(V,E), a set of random variables X=(Xv)v∈V indexed by V form a Markov random field with respect to G if they satisfy the local Markov properties:
Pairwise Markov property: Any two non-adjacent variables are conditionally independent given all other variables: Xu⊥⊥Xv∣XV∖{u,v} Local Markov property: A variable is conditionally independent of all other variables given its neighbors: Xv⊥⊥XV∖N[v]∣XN(v) where N(v) is the set of neighbors of v, and N[v]=v∪N(v) is the closed neighbourhood of v. Global Markov property: Any two subsets of variables are conditionally independent given a separating subset: XA⊥⊥XB∣XS where every path from a node in A to a node in B passes through S. The Global Markov property is stronger than the Local Markov property, which in turn is stronger than the Pairwise one. However, the above three Markov properties are equivalent for positive distributions (those that assign only nonzero probabilities to the associated variables). The relation between the three Markov properties is particularly clear in the following formulation:
Pairwise: For any i,j∈V not equal or adjacent, Xi⊥⊥Xj|XV∖{i,j}. Local: For any i∈V and J⊂V not containing or adjacent to i, Xi⊥⊥XJ|XV∖({i}∪J). Global: For any I,J⊂V not intersecting or adjacent, XI⊥⊥XJ|XV∖(I∪J).
Clique factorization As the Markov property of an arbitrary probability distribution can be difficult to establish, a commonly used class of Markov random fields are those that can be factorized according to the cliques of the graph. Given a set of random variables X=(Xv)v∈V, let P(X=x) be the probability of a particular field configuration x in X—that is, P(X=x) is the probability of finding that the random variables X take on the particular value x. Because X is a set, the probability of x should be understood to be taken with respect to a joint distribution of the Xv. If this joint density can be factorized over the cliques of G as
P(X=x)=∏C∈cl(G)φC(xC) then X forms a Markov random field with respect to G. Here, cl(G) is the set of cliques of G. The definition is equivalent if only maximal cliques are used. The functions φC are sometimes referred to as factor potentials or clique potentials. Note, however, conflicting terminology is in use: the word potential is often applied to the logarithm of φC. This is because, in statistical mechanics, log(φC) has a direct interpretation as the potential energy of a configuration xC. Some MRF's do not factorize: a simple example can be constructed on a cycle of 4 nodes with some infinite energies, i.e. configurations of zero probabilities, even if one, more appropriately, allows the infinite energies to act on the complete graph on V. MRF's factorize if at least one of the following conditions is fulfilled:
the density is strictly positive (by the Hammersley–Clifford theorem) the graph is chordal (by equivalence to a Bayesian network) When such a factorization does exist, it is possible to construct a factor graph for the network.
Exponential family Any positive Markov random field can be written as exponential family in canonical form with feature functions fk such that the full-joint distribution can be written as
P(X=x)=1Zexp(∑kwk⊤fk(x{k})) where the notation
wk⊤fk(x{k})=∑i=1Nkwk,i⋅fk,i(x{k}) is simply a dot product over field configurations, and Z is the partition function:
… excerpt ends here. Continue reading the full article.

