# How can I calculate a probability from a likelihood, e.g. in the Metropolis-Hastings algorithm?

This is a follow-up to my previous question, how can I compute a posterior density estimate from a prior and a likelihood

I am having difficulty understanding how it is possible to calculate the probability of a parameter set given its likelihood.

For example, in the answer to the previous question, the likelihood is used to weight the probability of sampling from the prior distributions.

However, the answer suggested I use a sequential sampling algorithm, so I have chosen to try a Metropolis-Hastings approach. However, it is not clear to me how I can use likelihoods to determine the probability that I will accept a proposed parameter set.

I can empirically estimate (using the R fitdistr function) that the likelihood is approximately $L\sim\textrm{log-}N(8, 0.7)$, I suppose that I could calculate the probability as plnorm(L, 8, 0.7) and the probability of acceptance as $P(L_\textrm{new})/P(L_\textrm{old})$. But is there a way to do this without assuming that the likelihood has some particular distribution? Or is it standard practice to make such an assumption?

The fitdistr function is an alternative to the Bayesian methodology, not usually a preparation for it. For both the Bayesian and the fitdistr approaches you specify a likelihood/distribution (it looks like you tried the log-normal) then estimate the parameters. If you use a difuse enough prior in the Bayesian method then you will find the answers match very closely between the 2 methods. But neither the fitdistr function or the Bayesian methods tell you whether the log-normal (or other) liklihood is the best or even appropriate one, for that you need to understand the science behind the data.
• thank you for your answer. I am stuck at the 'use the ratio of the likelihoods'. Isn't the magnitude of the likelihood a function of model complexity? If the likelihoods are all very large (e.g. 2000 +/- 100 or so), does it still make sense to take the ratio of these? From my understanding of MH, I thought that I would need to take the ratio of two probabilities bounded by [0,1] rather than two likelihoods of arbitrary magnitude. I guess that is why I am similarly confused about using the likelihood as weights with the sample function. – Abe Jul 27 '11 at 21:19
• I should clarify that I am actually assuming the functional form of the likelihood is double-exponential I didn't realize that $p(\textrm{accept}) = L_\textrm{new}/L_\textrm{old}$ was the correct calculation; I thought that I needed to calculate $p(L_\textrm{new})/p(L_\textrm{old})$. And to estimate $p(L)$ I used AIC(fitdistr()) to find the bset fit to the distribution of $L$ and so that I could determine the $p(L|\theta)$ for each value of $L$. – Abe Jul 27 '11 at 22:54