120 likes | 289 Views
Bayesian Inference Anders Gorm Pedersen Molecular Evolution Group Center for Biological Sequence Analysis Technical University of Denmark (DTU). Bayes Theorem. P(A | B) = P(B | A) x P(A) P(B) P(M | D) = P(D | M) x P(M) P(D).
E N D
Bayesian Inference Anders Gorm Pedersen Molecular Evolution Group Center for Biological Sequence Analysis Technical University of Denmark (DTU)
Bayes Theorem P(A | B) = P(B | A) x P(A) P(B) P(M | D) = P(D | M) x P(M) P(D) Reverend Thomas Bayes (1702-1761) P(D|M): Probability of data given model = likelihood P(M): Prior probability of model P(D): Essentially a normalizing constant so posterior will sum to one P(M|D): Posterior probability of model
Bayesians vs. Frequentists • Meaning of probability: • Frequentist: long-run frequency of event in repeatable experiment • Bayesian: degree of belief, way of quantifying uncertainty • Finding probabilistic models from empirical data: • Frequentist: parameters are fixed constants whose true values we are trying to find good (point) estimates for. • Bayesian: uncertainty concerning parameter values expressed by means of probability distribution over possible parameter values
Bayes theorem: example William is concerned that he may have reggaetonitis - a rare, inherited disease that affects 1 in 1000 people Prior probability distribution Doctor Bayes investigates William using new efficient test: If you have disease, test will always be positive If not: false positive rate = 1% William tests positive. What is the probability that he actually has the disease?
Bayes theorem: example II Model parameter: d (does William have disease) Possible parameter values: d=Y, d=N Possible outcomes (data): + : Test is positive - : Test is negative Observed data: + Likelihoods: P(+|Y) = 1.0 (Test positive given disease) P(-|Y) = 0.0 (Test negative given disease) P(+|N) = 0.01 (Test positive given no disease) P(-|N) = 0.99 (Test negative given no disease)
Bayes theorem: example III P(M | D) = P(D | M) x P(M) P(D) P(Y|+) = P(+|Y) x P(Y) = P(+|Y) x P(Y) P(+) P(+|Y) x P(Y) + P(+|N) x P(N) = 1 x 0.001 = 9.1% 1 x 0.001 + 0.01 x 0.999 Other way of understanding result: (1) Test 1,000 people. (2) Of these, 1 has the disease and tests positive. (3) 1% of the remaining 999 10 will give a false positive test => Out of 11 positive tests, 1 is true: P(Y|+) = 1/11 = 9.1%
Bayes theorem: example IV In Bayesian statistics we use data to update our ever-changing view of reality
MCMC: Markov chain Monte Carlo • Problem: for complicated models parameter space is enormous. • Not easy/possible to find posterior distribution analytically Solution: MCMC = Markov chain Monte Carlo Start in random position on probability landscape. Attempt step of random length in random direction. (a) If move ends higher up: accept move (b) If move ends below: accept move with probability P (accept) = PLOW/PHIGH Note parameter values for accepted moves in file. After many, many repetitions points will be sampled in proportion to the height of the probability landscape
MCMCMC: Metropolis-coupled Markov Chain Monte Carlo Problem: If there are multiple peaks in the probability landscape, then MCMC may get stuck on one of them Solution: Metropolis-coupled Markov Chain Monte Carlo = MCMCMC = MC3 MC3 essential features: • Run several Markov chains simultaneously • One chain “cold”: this chain performs MCMC sampling • Rest of chains are “heated”: move faster across valleys • Each turn the cold and warm chains may swap position (swap probability is proportional to ratio between heights) • More peaks will be visited More chains means better chance of visiting all important peaks, but each additional chain increases run-time
MCMCMC for inference of phylogeny Result of run: Substitution parameters Tree topologies
Posterior probability distributions of substitution parameters
Posterior Probability Distribution over Trees • MAP (maximum a posteriori) estimate of phylogeny: tree topology occurring most often in MCMCMC output • Clade support: posterior probability of group = frequency of clade in sampled trees. • 95% credible set of trees: order trees from highest to lowest posterior probability, then add trees with highest probability until the cumulative posterior probability is 0.95