Question: 5. Implement an MCMC algorithm to sample the posterior distribution of the ef- fective population size Ne given the tree simulated in the previous step.




5. Implement an MCMC algorithm to sample the posterior distribution of the ef- fective population size Ne given the tree simulated in the previous step. The proposal kernel should be a uniform random walk on the parameter Ne, so that Unif-10,10) and Ne Ne . The lower boundary of zero can be treated by reflection or rejection. The target distribution is the coalescent likelihood k-2 where tk is the time duration that the tree T has k lineages You may find that you need to calculation this target distribution in log space to avoid numerical underflow 72 In(Ne) 2Ne The the acceptance probability will be a = min (1, exp [In p(NJT) _ In p(NJT)] ) Notice above I gave you the coalescent likelihood, p(T|N), not the posterior p(Ne|T), so you need to also define a prior p(Ne) to compute the posterior (up to a constant). If you only use the coalescent likelihood as the target distribution you will be effectively using an (improper) uniform prior. Something like a diffuse log-normal makes a lot more sense Plot the posterior distribution of Ne from an MCMC chain of length 10,000 steps Plot the prior on the same graph Comment on how you would get a better estimate of the effective population size 5. Implement an MCMC algorithm to sample the posterior distribution of the ef- fective population size Ne given the tree simulated in the previous step. The proposal kernel should be a uniform random walk on the parameter Ne, so that Unif-10,10) and Ne Ne . The lower boundary of zero can be treated by reflection or rejection. The target distribution is the coalescent likelihood k-2 where tk is the time duration that the tree T has k lineages You may find that you need to calculation this target distribution in log space to avoid numerical underflow 72 In(Ne) 2Ne The the acceptance probability will be a = min (1, exp [In p(NJT) _ In p(NJT)] ) Notice above I gave you the coalescent likelihood, p(T|N), not the posterior p(Ne|T), so you need to also define a prior p(Ne) to compute the posterior (up to a constant). If you only use the coalescent likelihood as the target distribution you will be effectively using an (improper) uniform prior. Something like a diffuse log-normal makes a lot more sense Plot the posterior distribution of Ne from an MCMC chain of length 10,000 steps Plot the prior on the same graph Comment on how you would get a better estimate of the effective population size
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
