Suppose we have a [Markov Random Field](http://en.wikipedia.org/wiki/Markov_random_field) P(X1,...,Xn) on graph G. Suppose we know P(Xi,Xj) for every edge (i,j). Can we recover P(X1,...,Xn)?


If G is a tree, then there's a formula for joint (product of edge marginals divided by product of node marginals). Is there a nice formula that works for some non-tree graphs?


Edit: this is essentially equivalent to the following problem - given an exponential family, how do you write the joint in terms of mean parameters? There's a closed form solution when sufficient statistics are 2 variable functions defined on (Xi,Xj) pairs where (i,j) are edges in some tree graph, is there a closed form solution for other graphs?


Motivation: given an approximate marginalization method, can you fit parameters of a distribution by maximizing joint likelihood of the data under the model "implied" by this marginalization method?



Recovering joint distribution from marginals
No, a counter-example can be constructed as follows:


Let G be the complete graph on 3 vertices, where each vertex is a binary random variable. Let the joint distribution for each pair of vertices be independent Bernoulli with probability 1/2. 


There are multiple joint distributions which satisfy such edge marginals. For example:


* Independent Bernoulli for each vertex, with probability 1/2 (complete mutual independence)
* Each variable could be the XOR (sum modulo 2) of the other two variables (i.e. functionally dependent)
* The probability of each outcome could be 3/16 if 3 or 1 vertices are 1's, and 1/16 if 2 or 0 are 1's.


So what do you require to be able to uniquely determine the joint distribution? If the graph is decomposable (aka chordal or triangulated), you require the joint distribution for each clique (maximal complete subset) of the graph. Then the joint density is then:


$p(X) = \frac{\prod\_{\text{cliques }C} p(X\_C)}{\prod\_{\text{separators }S} p(X\_S)}$


(see [Dawid and Lauritzen (1993)](http://projecteuclid.org/euclid.aos/1176349260), Lemma 2.5)


If the graph is not decomposable, then the problem is a bit trickier: the only result I know of is [Lauritzen (1996)](http://books.google.co.uk/books?id=mGQWkx4guhAC&printsec=frontcover), Lemma 3.14. Basically, given the clique marginal distributions, uniqueness is determined when the sample space is finite, and each clique marginal density is the limit of a sequence of positive densities. I suspect this result could be made stronger in some way, but I am not aware of any efforts to do so.


