Lecture 18: Bayesian ANOVA Flashcards
hoe ziet de prior knowledge er uit bij bayesian
in de vorm van een probability distribution that characterizes our prior knowledge, tussen 0 and 1.
wat gebruik je voor een proportion als prior distribution
een beta distribution
wat is het lastige aan een prior distribution
heel subjective
BF =1 betekent
dat beiden modellen even goed kunnen predicten.
BF>1 betekent
more and more evidence for one of the models
BF kan nooit…
negatief zijn (want het is een ratio)
dus grootste verschil in doelen van frequentist en bayesian statistics (gaat over conditioning)
- frequentist: the probability of the data or more extreme, given the null hypothesis
- bayesian: the probability of different parameters given the data
statistical models van theta: wat is het doel?
we are trying to inference for the population value: what do we think are likely values for the parameter values?
hoe heet het als een prior distribution heel scherp is gericht op een value (= sarahs model in voorbeeld)
een spike prior
wat doen we vervolgens met deze prior distribution
we look at: what are likely values if this model were true? how likely are the data, given the model is true?
waar lijkt een distribution bij theta = 0.5 op?
op een sampling distribution if the null would be true. (=frequentist testing)
wat is het verschil tussen freq en bayesian wat betreft de probability waar je naar kijkt
freq= the probability of the data, or more extreme
bayes= the probability of the data specifically
wat is de formule van bayesian model=
n! / k!(n-k)! * theta(1-theta)^n-k
dus als je een spiked prior kiest, vul je dit getal in als theta. maar wat als je een hele range aan values kiest voor de theta?
dan moet je kijken naar elke postulated value van theta tussen … en … (dus alle values die de prior distribution verwacht) en dan vervolgens kijken naar de likelihood van deze date voor elke mogelijke value. dan kijken naar het gemiddelde van al deze likelihoods, weighted by the density at each point.
=marginalizing -> marginal likelihood (=average likelihood)
hoe kan het dat, als Betty bijv zegt dat theta <0.5, je in de marginal likelihood graph nog steeds values onder 0.5 ziet staan?
omdat theta = parameter, dus het gemiddelde van de populatie. in de marginal likelihood zie je alle mogelijke waardes. hoewel de probability van heads bijvoorbeeld 0.6 is, heb je nog steeds een kans om 3/10 keer heads te gooien in de gehele populatie.
statistical model =
A statistical model is a combination of a general statistical model (e.g., the binomial model) and a statement about a parameter value that describe a certain phenomenon. A statistical model can also be seen as a hypothesis: a specific statement about the value of the model parameters.
wanneer heb je een binominal model
als je een series of chance based events hebt, met een uitkomst met 2 mogelijkheden
wat is het uiteindelijke doel van een statistisch model, wat doen we hiermee?
We can use the accuracy of these predictions of the model to gauge the quality/plausibility of a model, relative to another model.
wat is k in de formule
k = data die je hebt gevonden (bv 8 keer heads gooien)
wat is n in de formule
n = de hoeveelheid data die je in totaal hebt verzamelt (bv 10 keer gooien)
difference in freq vs bayesian wat betreft de samples
freq = large samples usually needed
bayesian = not necessarily need large samples
difference in freq vs bayesian wat betreft de nature of the parameters in the model
freq = unknown nature, but fixed
bayesian = unknown and therefore random
difference in freq vs bayesian wat betreft de population parameter
freq = one true value
bayesian = a distribution of values, reflecting uncertainty
difference in freq vs bayesian wat betreft: uncertainty is defined by
freq: the sampling distribution based on the idea of infinite repeated sampling
bayesian: a probability distribution for the population parameter
difference in freq vs bayesian wat betreft de estimated intervals
freq: confidence interval
bayesian: credibility interval
confidence interval interpretatie
over an infinity of samples taken from the population, 95% of these contain the true population value
credibility interval interpretatie
a 95% probability dat de population value is within the limits of the interval
bayes factor =
how well did model 1 predict the data / how well did model 2 predict the data
= dus de likelihood van de gevonden data. (bv likelihood van 8 keer heads gooien)
wat is de interpretatie van BF10= 4
this means that the observed data are about 4 times more likely under model 1 than under model 0.
wat is de interpretatie van BF01=0.25
de data zijn 0.25 keer meer likely onder model 1, dan onder model 0.
hoe ga je van BF01 naar BF10
1 / Bayesfactor
wat als de modellen de data even goed voorspellen
BF=1
Generally, we want the Bayes factor to be as far away from 1 as possible, since this indicates more and more evidence in favor of one model over another.
strong evidence for H0=
BF10 = 1/30 tot 1/10
moderate evidence for H0 =
BF10= 1/10 tot 1/3
weak evidence voor H0 en H1
BF10= 1/3 tot BF10 = 3
moderate evidence for H1=
BF10 = 3 tot 10
strong evidence for H1=
BF10= 10 tot 30
maar wat is belangrijk bij de interpretatie van evidence voor H1 en H0
niet absolute regels, geen all or nothing conclusions.
hoe heet een model die elke waarde van theta even plausibel vind
uninformed model
hoe maak je dan vervolgens vergelijkingen tussen twee modellen, gebaseerd op deze grafieken?
de ratio nemen van de gele staven, dus de marginal likelihood voor de gevonden data, van beiden modellen.
marginal likelihood model 1/marginal likelihood model 2
concept of parsimony in bayesian statistics =
means that more specific models are being rewarded more (when predicting well) than their non-specific competitor
wat is de meest gebruikte vergelijking van 2 modellen
een uninformed model vs een nulmodel (met theta = 0.5).
transivity in bayesian statistics=
Since we know how much more likely the data are under Betty’s model than under Alex’ model (about 2 times), and how much more likely the data are under Alex’ model than under Sarah’s model (about 2 times), we also now know that Betty’s model is about
2x2=4 times more likely than Sarah’s model!
The Bayes factor is a relative metric, comparing 2 models at a time
The subscript of the Bayes factor indicates which model is compared to which
More specific predictions, when accurate, are rewarded (parsimony)
oke
Instead of comparing models, however, we can also …
look at one model, and use it to estimate the value of theta. We will see that each of the models presented above will yield different estimates, because they had different a priori (i.e., before seeing the data) beliefs about plausible values of theta
Because we are working with a continuous range of values for theta, the difference between saying theta<0.5 and t theta <= theta is infinitely small and the two versions may be used interchangeably
oke
wat is de formule voor de posterior
p(θ|data) = (p(data|θ) * p(θ)) / p(data)
wat is p(data|θ)
likelihood
wat is p(θ)
prior
wat is p(θ|data)
posterior
wat is p(data)
average prediction acrosss all θ’s
wat is een andere manier om de formule te schrijven van bayesian
p(θ|data)= p(θ) * p(data|θ) / p(data)
wat is de predictive updating factor
p(data|θ) / p(data)
wat laat de predictive updating factor zien
it shows how each possible value of theta predicted the observed data, relative to all other possible values of theta.
Belief is a funny word and we tend to associate the word with things that have seemingly little to do with science or statistics. However, we have beliefs about anything in the world – they might be quite weak, but we still have some starting point for reasoning about some phenomenon. For instance, I know very little about the number of penguins in the world, but I do know there are more than 0, probably more than 1000
, and fewer than 1.000.000.000 of them
oke
hoe bereken je p(data|θ)
ook in de n & k formule zetten, en dan dat voor elke mogelijke waarde van θ.
bv beginnen met theta = 0,5; dat invullen.
wat is de likelihood NIET???
likelihood =/= probability distribution!!!
surface area =/= 1, en dus geen probabilistic statements maken over de parameter
de marginal likelihood is een …. value
singular value, dus gewoon een nummer!!
marginal likelihood =
average of all the likelihoods, where the likelihood of each theta value is weighted by the prior belief placed on that value by the model
wat vergelijk je dus bij de bayes factor, qua formule?
p(data|θ) van mdoel 1 vs model 2
dus likelihood, welke formule?
p(data|θ)
wat is de predictive updating factor in termen
likelihood / marginal likelihood
hoe vergelijk je twee modellen onder het bayesian framework
compare the marginal likelihoods of each of the models: how likely are the data under model 1, and how likely are the data under model 2?
wat is dan de bayes factor
the data are …. more likely under model 1 as under model 2
hoe zie je marginal likelihood visually
dat is de grafiek met het gele staafje, dat is marginal likelihood! gaat echt over model comparison
predictive updating factor=
likelihood of the observed data, for each value of theta. dus je stopt een theta in die formule, en dan krijg je de likelihood. dat doe je voor alle mogelijke waarden van theta, en daaruit komt dan een grafiek: de likelihood = predictive updating factor
wat staat er op de grafiek van predictive updating factor
x as = θ
y as = P(data|θ).
wat zie je bij een statistical model op de grafiek
x as = θ
y as = density
wat zie je op de grafiek van likelihood
x as = dependent variable
y as = likelihood
op welk level is bayesian inference:
P(θ|data)
op het level van de parameter
wat is het verschil in likelihood en marginal likelihood in terms van een formule
likelihood is een function, gaat over alle mogelijke waarden van theta die dan een eigen likelihood krijgen.
marginal likelihood is het gemiddelde van de likelihood, dit is maar één getal!! -> how well did the values in the model predict the data on average?
predictive updating factor interpretatie
how well did each value in the model predict the data, compared to the average of the other models in the data?
als je twee modellen vergelijkt met elkaar, waar staat de bayes factor dan gelijk aan
aan de predictive updating factor:
p(H1|data) / p(H0|data)
op welk level is bayesian hypothesis testing:
p(H1|dat)/p(H0|data)
op het level van de hypothese
wat is het verschil tussen een prior distribution en prior odds
prior distribution is op θ level, en dus parameter. -> distribution
prior odds is op H1 en H0 level, en gaat dus over hypothesen. -> single value
dus twee soorten prior
prior distribution: p(θ)
prior odds: p(H1)/p(H0)
bayes factor formule
p(data|H1) / p(data|H0)
bayesian t test: wat meten we?
de difference between groups: cohen’s d / delta. δ
= a standardized difference between groups
wat voor distribution for bayesian t test
cauchy distribution
wat zijn karaktereigenschappen van de cauchy distribution
- df = 1
- t-distribution
why would a uniform distribution not work for bayesian t test
omdat delta een infinite domain heeft
bayesian anova = extension of the t test
oke
wat is P(M) in bayesian statistics
prior model: how likely do we deem each of the models before seeing the data?
standaard: 0.5
wat is P(M|data)
posterior model probabilities, updated prior using the PUF/BF
dus dit geeft al een indicatie van welk model meer evidence heeft.
BF10
compares all of the models to another model (default: all models are compared to the best model)
dus kijken naar: wat was het beste model bij P(M|data) -> de hoogste = beste model, daar wordt de rest mee vergeleken.
waarom kan je dus een 1 zien staan bij de BF10
omdat het model met het beste model wordt vergeleken: als dit het model zelf is, zal de BF altijd gelijk zijn aan 1 (want hij wordt vergeleken met zichzelf)
wat is BFm
dit vergelijkt een model met al de andere modellen -> marginal likelihood of one model compared to marginal likelihood of the other models
(als er maar twee modellen zijn is dit dus het verschil tussen deze twee modellen).
wat kan je zien bij effects bij bayesian anova
kijken naar het verschil tussen predictor variables.
wat is BF incl bij effects
laat zien hoeveel meer likely de data is onder de H1 dan onder de H0. compares groups of models to groups of models
model averaged posterior distribution =
how much does the model deviate from the grant mean?
kunnen we bij bayesian ook post hoc tests doen
ja, pairwise comparisons. basically bayesian pairwise t tests.
waar kijk je dus naar bij bayesian anova tabel
naar BFm: how well does the model do, compared to all other models
of
BF10: compares the model to the best model
of
BFincl; laat zien hoe veel beter dit model het doet vergeleken met modellen die niet de predictor hebben
komt vaak op hetzelfde uit, omdat we vaak maar 2 modellen hebben.
you can quantify evidence for inclusion of the null or for the H1. but you cannot quantify evidence for exclusion
oke
de aanwezigheid van een interactie effect laat zien….
dat je eigenlijk niet alleen meer over main effects kan praten.
(daarom heeft ANCOVA ook een assumption dat er geen interactie is tussen predictor en covariate).
hoe kan je bayesian visualiseren
descriptive plots: horizontal axis = dependent, separate lines = groups/independent
wat betekent een kruizing in de lijnen van descriptive plot
INTERACTION EFFECT!!!!