t homas b ayes to the rescue st5219: bayesian hierarchical modelling lecture 1.4
TRANSCRIPT
![Page 1: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/1.jpg)
THOMAS BAYES TO THE RESCUEst5219: Bayesian hierarchical modelling
lecture 1.4
![Page 2: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/2.jpg)
BAYES THEOREM: MATHS ALERT
(You know this already, right?)
![Page 3: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/3.jpg)
BAYES THEOREM: APPLICATION
You are GP in country like SP Foreign worker comes for HIV test HIV test results come back +ve Does worker have HIV?
How to work out?Test sensitivity is 98%Test specificity is 96%
ie f(test +ve | HIV +ve) = 0.98
f(test +ve | HIV --ve) = 0.04
![Page 4: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/4.jpg)
BAYES THEOREM: APPLICATION
Analogy to hypothesis testing Null hypothesis is not infected Test statistic is test result p-value is 4% Reject hypothesis of non-
infection, conclude infected
But we calculated:f(+ test | infected)
NOT f(infected | + test)
![Page 5: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/5.jpg)
BAYES THEOREM: APPLICATION
How to work out?Test sensitivity is 98%Test specificity is 96%Infection rate is 1%
ie f(test +ve | HIV +ve) = 0.98
f(test +ve | HIV --ve) = 0.04f(HIV +ve) = 0.01
![Page 6: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/6.jpg)
BAYES THEOREM: APPLICATION
![Page 7: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/7.jpg)
BAYES THEOREM: APPLICATION
![Page 8: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/8.jpg)
AIDS AND H0S
Frequentists happy to use Bayes’ formula here
But unhappy to use it to estimate parameters But...
If you think it is wrong to use the probability of a positive test given non-infection to decide if infected given a positive test why use the probability of (imaginary) data
given a null hypothesis to decide if a null hypothesis is true given
data?
![Page 9: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/9.jpg)
THE BAYESIAN ID AND FREQUENTIST EGO
How do you normally estimate parameters?
Is theta hat the most likely parameter value?
![Page 10: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/10.jpg)
THE BAYESIAN ID AND FREQUENTIST EGO
The parameter that maximises the likelihood function is not the most likely parameter value
How can we get the distribution of the parameters given the data?
Bayes’ formula tells us
posteriorlikelihood prior
(this is a constant)
![Page 11: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/11.jpg)
UPDATING INFORMATION VIA BAYES
Can also work with
1. Start with information before the experiment: the prior
2. Add information from the experiment: the likelihood
3. Update to get final information: the posterior
• If more data come along later, the posterior becomes the prior for the next time
![Page 12: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/12.jpg)
UPDATING INFORMATION VIA BAYES
1. Start with information before the experiment: the prior
2. Add information from the experiment: the likelihood
3. Update to get final information: the posterior
![Page 13: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/13.jpg)
UPDATING INFORMATION VIA BAYES
1. Start with information before the experiment: the prior
2. Add information from the experiment: the likelihood
3. Update to get final information: the posterior
![Page 14: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/14.jpg)
UPDATING INFORMATION VIA BAYES
1. Start with information before the experiment: the prior
2. Add information from the experiment: the likelihood
3. Update to get final information: the posterior
![Page 15: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/15.jpg)
Mean:
SUMMARISING THE POSTERIOR
Median:
Mode:
![Page 16: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/16.jpg)
SUMMARISING THE POSTERIOR
95% credible interval: chop off 2.5% from either side of posterior
![Page 17: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/17.jpg)
SUMMARISING THE POSTERIOR
Bye bye
delta approximation
s!!!
![Page 18: T HOMAS B AYES TO THE RESCUE st5219: Bayesian hierarchical modelling lecture 1.4](https://reader035.vdocuments.us/reader035/viewer/2022062304/56649e0d5503460f94af7031/html5/thumbnails/18.jpg)
SOUNDS TOO EASY! WHAT’S THE CATCH?!
Here are where the difficulties are:1. building the model2. obtaining the posterior3. model assessment
Same issues arise in frequentist statistics (1, 3); estimating MLEs and CIs difficult for non à la carte problems
Let’s see an example! Back to AIDS!