Bayesian Inference!!!
description
Transcript of Bayesian Inference!!!
Bayesian Inference!!!
Jillian Dunic and Alexa R. Wilson
Step One: Select your model (fixed, random, mixed)
Moment Based & Least Squares
Step Two: What’s your distribution?
Step Three: What approach will you use to estimate your parameters?
Likelihood
ASK:Are your true values known?Is your model relatively “complicated”?
Bayesian
No Yes
*gives approximation *both methods giving true estimates
Frequentist vs. Bayes• Data are random
• Parameters are unknown constants
• P(data|parameter)
• No prior information
• In a vacuum
• Data are fixed
• Parameters are random variables
• P(parameters|data)
• Uses prior information
• Not in a vacuum
http://imgs.xkcd.com/comics/frequentists_vs_bayesians.png
So what is Bayes?
So what is Bayes?Bayes Theorem:
http://imgs.xkcd.com/comics/frequentists_vs_bayesians.png
So what is Bayes?Bayes Theorem:
http://imgs.xkcd.com/comics/frequentists_vs_bayesians.png
Likelihood Prior
Bayes• Bayes is likelihood WITH prior information
• Prior + Likelihood = Posterior(existing data) + (frequentist likelihood) = output
• Empirical Bayes: when like the frequentist approach, you assume S2 = σ2 ...whether you do this depends on the sample size
Choosing PriorsChoose well, it will influence your results…
• CONJUGATE: using a complimentary distribution
• PRIOR INFORMATION: data from literature, pilot studies, prior meta-analyses, etc.
• UNINFORMATIVE: weak, but can be used to impose constraints and good if you have no information
Uninformative Priors• Mean: Normal distribution (-∞, ∞)
• Standard deviation: Uniform distribution (0, ∞)
Example of uninformative variance priors
Inverse gamma distribution
Inverse chi-square distribution
Priors and Precision
Prior
Likelihood
Posterior
The influence of your priors and your likelihood in the posterior depends on their variance; lower variance, greater weight (and vice versa)
So why use Bayes over likelihood?
• If using uninformative priors, results are ~LL
• Bayes can treat missing data as a parameter
• Better for tricky, less common distributions
• Complex data structures (e.g., hierarchical)
• If you want to include priors
More Lepidoptera!
Ti
Ti
Ti
Ti
Ti
Ti
Choosing priors• No prior information use
uninformative priors
• Uninformative priors:–Means normal– Standard Deviation uniform
Prior for mean µ
Prior for variance: τ2
MCMC general process• Samples the posterior distribution you’ve generated
(prior + likelihood)
• Select starting value (e.g., 0, educated guess at parameter values, or moment based/least squares values)
• Algorithm structures search through parameter space (tries combinations of parameters simultaneously if multivariate model)
• Output is a posterior probability distribution
Si2 = 0.02
Si2 = 0.02
Si2 = 0.26
Grand mean conclusions• Overall mean effect size = 0.32
• Posterior probability of positive effect size is 1, so we are almost certain the effect is positive.
Example 2 – Missing Data!• Want to include polyandry as fixed
effect
• BUT missing data from 3 species
Bayes to the rescue!
What we knowBusseola fusca = monandrous
Papilio machaon = polyandrous
Eurema hecabe = polyandrous
• Monandry < 40% multiple mates• Polyandry > 40% multiple mates
So what do we do?Let’s estimate the values for the missing percentages!
Set different, and relatively uninformative priors for monandrous and polyandrous species
Prior for XM
Prior for XP
Final Notes & Re-CapAt the end of the day, it is really just another method to achieve a similar goal, the major difference is that you are using likelihood AND priors
• REMEMBER: Bayes is a great tool in the toolbox for when you are dealing with:– Missing data– Abnormal distributions– Complex data structures– Or have/want to include prior information