Solved – Priors in Bayesian MCMC

bayesianmarkov-chain-montecarlopriorr

I am trying to understand how the choice of priors affects a Bayesian model estimated using MCMC. At a basic level I understand that the product of the prior and the likelihood are proportional to the posterior. However, I do not fully understand (a) how to place more or less weight on the prior or (b) how the prior in this example influences the results. The prior in this example is defined as:

# Prior distribution
prior <- function(param){
    a = param[1]
    b = param[2]
    sd = param[3]
    aprior = dunif(a, min=0, max=10, log = T)
    bprior = dnorm(b, sd = 5, log = T)
    sdprior = dunif(sd, min=0, max=30, log = T)
    return(aprior+bprior+sdprior)
}

As I understand the example, whatever value of b was drawn by the proposal function is considered by the prior to be the most probable. Is that correct? Doesn't this prior essentially place all of the action on the likelihood function because all values of b will have the same density under the prior that the proposed b is the mean of b's distribution?

More generally, how do I place more or less weight on the prior in the posterior. If $\text{posterior} \propto \text{prior} \times \text{likelihood}$ I don't know how to adjust the weight of the prior. If it's in log form as in the example the log of the posterior is defined as:

posterior <- function(param){
   return (likelihood(param) + prior(param))
}

Here it seems like I could put a weight in front of either the likelihod or the prior. For example, likelihood(param) + 2 * prior(param) would give the prior twice as much weight as the likelihood. Is that intuition correct or am I on the wrong track?

Best Answer

A prior is a distribution.

You don't really weight that distribution, Bayes' rule does.

However, if you're thinking of your prior distribution as representing uncertainty "about" some value you expect a priori, so that the mode (or whatever measure of the center) of the prior expresses your prior knowledge of where you think it lies and the spread represents the uncertainty about where it is, then increasing the spread puts less weight near that prior central value and decreasing the spread puts more weight near that prior central value.

So choose a more concentrated prior to put more weight near that value.