# How to use Gibbs sampling when target function is known only up to normalising constant?

Assume we want to use Gibbs sampling to get an estimate of the parameter $\lambda$, and that we have the following expression for the conditional posterior of $\lambda$:

$f(\lambda&space;|\theta&space;,\mathbf{t},\tau&space;)\propto\lambda^{\tau+1&space;}e^{-\lambda(\theta+t_{1}-t_{0})}$

If I am not mistaken, this means that the conditional posterior is proportional to the PDF of a Gamma distribution, which should then imply that:

$f(\lambda&space;|\theta&space;,\mathbf{t},\tau&space;)\&space;=&space;c\lambda^{\tau+1&space;}e^{-\lambda(\theta+t_{1}-t_{0})}$

where c is the normalising constant for the distribution. In that case, the tricky part comes now. Does the above expression mean that:

$\lambda&space;|\theta&space;,\mathbf{t},\tau&space;\&space;\sim&space;\Gamma&space;(\tau+2,&space;\theta+t_{1}-t_{0})$

or is this where I get lost? A mixture of gut feeling and extensive searches here on Cross Validated and Google in general are telling me that I am missing something, that I have to use the normalising constant c somehow to adjust the observations generated by simulating from $\Gamma&space;(\tau+2,&space;\theta+t_{1}-t_{0})$ . If my gut and browsing history are in the right, exactly what is the adjustment? I've tried to figure it out but I think I might have just stared myself blind at this point.

Also, to avoid as much confusion as possible on my part, in this case, the normalising constant c would be

$\frac{(\theta+t_{1}-t_{0})^{(\tau+2,)&space;}}{\Gamma&space;(\tau+2,)}$

or have I misunderstood this? (Obs: here, $\Gamma$ simply denotes the Gamma function, not the Gamma distribution.)

• you have the right conditional distribution and its normalizing constant. – Taylor Mar 3 '18 at 19:50
• (+1) There is no missing normalising constant since it is uniquely defined. Hence, identifying that the conditional posterior is a Gamma is good enough. – Xi'an Mar 3 '18 at 20:13
• So to double check that I've understood you correctly; the Gamma distribution as I have defined it above is the correct distribution to use to sample my lambda? No adjustments need be made? – Frankie Mar 4 '18 at 0:04

## 1 Answer

To expand on Xi'an's comment, the normalizing constant is uniquely defined, so there is only one possible value of $c$. For a general situation, suppose $X$ is a random variable with pdf $f(x)$ such that

$$f(x) \propto g(x) \Rightarrow f(x) = cg(x)\,.$$

The important thing to note here is that $c$ is uniquely defined, and in fact is $$c = \dfrac{1}{\int g(x) dx}\,.$$

In your problem, $$f(\lambda \mid \theta, t, \tau) \propto \lambda^{\tau+1}e^{-\lambda(\theta+t_1 - t_0)}\,.$$

You know that $f(\lambda \mid \theta, t, \tau)$ must have a proper probability density function, and thus the normalizing constant must be such that the right hand side integrates to 1. You know that the normalizing constant for a $\Gamma(\tau+2, \theta + t_1 - t_0)$ will definitely make it integrate to 1, and the normalizing constant is uniquely defined. Together this means that the conditional distribution for $\lambda$ can only be $\Gamma(\tau+2, \theta + t_1 - t_0)$.