5
$\begingroup$

Say we have a nasty probability distribution like, $$ P(x) = \frac{P^*(x)}{Z} $$ where we can easily compute $P^*(x)$ for a given $x$ but not $P(x)$ because partition function $Z$ is expensive to compute. There are approximation techniques like Monte Carlo which can be used to estimate the expectation of functions under this distribution.

Instead of some expectations, if we want a probability of some $x$, can we get it using some sampling techniques? Can we approximate the partition function $Z$ itself? I can't see resources which do these approximations, probably because it is not a standard thing to do.

$\endgroup$
1
  • 1
    $\begingroup$ I wish I understood what this question was asking, because it sounds like it's asking something I should know. I presume its my own ignorance I've just run into, rather than a problem with the question, but it couldn't hurt to try to make the question clearer/more accessible either way. On the basis that it at least sounds interesting, I'm going to upvote. $\endgroup$
    – Glen_b
    Commented Jun 19, 2013 at 23:02

3 Answers 3

4
$\begingroup$

In the context of restricted Boltzmann machines, a specialised form of annealed importance sampling has been developed by Salakhutdinov: http://www.cs.toronto.edu/~rsalakhu/papers/bm.pdf.

This TR also goes over some other schemes.

For latent variable models of the form $p(x) = \sum_z p(x|z)p(z)$ where a good approximation $q(z|x) \approx p(z|x)$ is available, Rezende et al propose an importance sampler in this paper: $$ p(x) \approx {1 \over S} \sum_{s=1}^S {p(x|z_s)p(z_s) \over q(z_s|x)}, \\ z_s \sim q(z|x) $$ This estimator works ridiculously well and fast. You might need to implement it using the log sum exp trick for numerical stability, though.

$\endgroup$
0
2
$\begingroup$

In the context of restricted Boltzmann machines there is one way to go about it: not to find an approximation to the partition function, but to approximate the gradients of the partition function (see Training products of experts by minimizing contrastive divergence by G. Hinton), which in addition is easy to implement.

The rationale is that, when learning a model of that kind, calculating the exact gradients of the partition function is computationally prohibitive. But because of a monotonicity condition, we can find an approximation of the gradients which is warranted not to get worse at every step (kind of like EM algorithm).

There are other approaches where one looks for a "good" approximation of the partition function (variational methods). But I am regretfully not familiar with them.

$\endgroup$
0
$\begingroup$

I'm not an expert on nasty distributions, but is there any reason why you can't estimate Z directly? And by directly I mean using numerical integration of p*(x) rather than using monte carlo.

The partition function is a multiplicative constant with respect to x, assuring that the probability integrates to 1, and as such you can easily estimate it and plug it into your density.

As as far I can tell the answers are: no sampling necessary, we can approximate Z, for a fixed set of parameters it's a scalar, and you can do it in any programming language, or online using wolfram alpha if you prefer.

Basically, if p*(x) is easy to compute so is Z.

$\endgroup$
5
  • $\begingroup$ Z involves a sum over a lot of variables (thousands) and it is taking a lot of time in my program. I would like to approximate it to reduce the speed. $\endgroup$
    – Rex Roy
    Commented Jun 19, 2013 at 23:16
  • 1
    $\begingroup$ Sorry, I still don't understand what is the problem, so I try to go into more detail. My suggestion was that it doesn't matter what actual form the Z has. As long as you can calculate p*(x) fast, you can integrate p*(x) numerically with any precision you desire. Z is equal to that integral. $\endgroup$ Commented Jun 19, 2013 at 23:22
  • $\begingroup$ If the probability distribution is discrete, then in principle you could do numeric summation. But then I'd guess that typically the probability space is complicated and doesn't allow for the standard numerical summation algorithms. $\endgroup$
    – Erik P.
    Commented Jun 26, 2013 at 12:36
  • 1
    $\begingroup$ The point is that evaluating a multi-dimensional integral using classical methods can be very expensive indeed as @RexRoy says. In these sorts of cases one often turns to Monte Carlo methods, but that puts us right back where we started. $\endgroup$
    – TooTone
    Commented Mar 23, 2014 at 12:15
  • $\begingroup$ OK, I re-read your post and my comment and I am confused by both. (Which means that my answer is utterly useless.) I seem to equate "p*(x) can be easily computed", with "the function is not too complicated". In which case you might really not need approximations. But if you cannot calculate the integral and you need it, you can of course use an approximate method such as Monte Carlo to calculate it. $\endgroup$ Commented Mar 24, 2014 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.