MCMC for Poisson response models

Slides:



Advertisements
Similar presentations
Estimating the False Discovery Rate in Multi-class Gene Expression Experiments using a Bayesian Mixture Model Alex Lewin 1, Philippe Broët 2 and Sylvia.
Advertisements

Missing data – issues and extensions For multilevel data we need to impute missing data for variables defined at higher levels We need to have a valid.
Lecture 22 Spatial Modelling 1 : Incorporating spatial modelling in a random effects structure.
Generalised linear mixed models in WinBUGS
Lecture 9 Model Comparison using MCMC and further models.
Introduction to Monte Carlo Markov chain (MCMC) methods
Other MCMC features in MLwiN and the MLwiN->WinBUGS interface
Lecture 23 Spatial Modelling 2 : Multiple membership and CAR models for spatial data.
MCMC estimation in MlwiN
MCMC for multilevel logistic regressions in MLwiN
The logic behind a statistical test. A statistical test is the comparison of the probabilities in favour of a hypothesis H 1 with the respective probabilities.
Latent normal models for missing data Harvey Goldstein Centre for Multilevel Modelling University of Bristol.
Chapter 3 Some Special Distributions Math 6203 Fall 2009 Instructor: Ayona Chatterjee.
Factorial Mixture of Gaussians and the Marginal Independence Model Ricardo Silva Joint work-in-progress with Zoubin Ghahramani.
INTRODUCTION TO MACHINE LEARNING Bayesian Estimation.
© 2009, KAISER PERMANENTE CENTER FOR HEALTH RESEARCH Getting to Know Your Data Basic Data Cleaning Principles.
Sampling Distributions for Proportions Allow us to work with the proportion of successes rather than the actual number of successes in binomial experiments.
Engineering Probability and Statistics - SE-205 -Chap 4 By S. O. Duffuaa.
An Optimal Learning Approach to Finding an Outbreak of a Disease Warren Scott Warren Powell
A Two Level Monte Carlo Approach To Calculating
July 3, A36 Theory of Statistics Course within the Master’s program in Statistics and Data mining Fall semester 2011.
Generalized Linear Models
4-1 Continuous Random Variables 4-2 Probability Distributions and Probability Density Functions Figure 4-1 Density function of a loading on a long,
Review of Lecture Two Linear Regression Normal Equation
© Willett, Harvard University Graduate School of Education, 8/27/2015S052/I.3(c) – Slide 1 More details can be found in the “Course Objectives and Content”
Moment Generating Functions 1/33. Contents Review of Continuous Distribution Functions 2/33.
Biostatistics Case Studies 2005 Peter D. Christenson Biostatistician Session 4: Taking Risks and Playing the Odds: OR vs.
Modelling non-independent random effects in multilevel models William Browne Harvey Goldstein University of Bristol.
Binomial Distributions Calculating the Probability of Success.
A Beginner’s Guide to Bayesian Modelling Peter England, PhD EMB GIRO 2002.
Generalized Linear Models II Distributions, link functions, diagnostics (linearity, homoscedasticity, leverage)
Department of SOCIAL MEDICINE Producing Small Area Estimates of the Need for Hip and Knee Replacement Surgery ANDY JUDGE Nicky Welton Mary Shaw Yoav Ben-Shlomo.
Analysis of Residuals Data = Fit + Residual. Residual means left over Vertical distance of Y i from the regression hyper-plane An error of “prediction”
Linear Model. Formal Definition General Linear Model.
Multilevel Modeling Software Wayne Osgood Crime, Law & Justice Program Department of Sociology.
© Department of Statistics 2012 STATS 330 Lecture 20: Slide 1 Stats 330: Lecture 20.
STA 216 Generalized Linear Models Meets: 2:50-4:05 T/TH (Old Chem 025) Instructor: David Dunson 219A Old Chemistry, Teaching.
Example: Bioassay experiment Problem statement –Observations: At each level of dose, 5 animals are tested, and number of death are observed.
Introduction to logistic regression and Generalized Linear Models July 14, 2011 Introduction to Statistical Measurement and Modeling Karen Bandeen-Roche,
Learning to Detect Events with Markov-Modulated Poisson Processes Ihler, Hutchins and Smyth (2007)
1 Multivariable Modeling. 2 nAdjustment by statistical model for the relationships of predictors to the outcome. nRepresents the frequency or magnitude.
Review of fundamental 1 Data mining in 1D: curve fitting by LLS Approximation-generalization tradeoff First homework assignment.
Logistic Regression Saed Sayad 1www.ismartsoft.com.
ALISON BOWLING MAXIMUM LIKELIHOOD. GENERAL LINEAR MODEL.
Beginning Statistics Table of Contents HAWKES LEARNING SYSTEMS math courseware specialists Copyright © 2008 by Hawkes Learning Systems/Quant Systems, Inc.
Variance Stabilizing Transformations. Variance is Related to Mean Usual Assumption in ANOVA and Regression is that the variance of each observation is.
Spatially Explicit Capture-recapture Models for Density Estimation 5.11 UF-2015.
1 Spatial assessment of deprivation and mortality risk in Nova Scotia: Comparison between Bayesian and non-Bayesian approaches Prepared for 2008 CPHA Conference,
732G21/732G28/732A35 Lecture 3. Properties of the model errors ε 4. ε are assumed to be normally distributed
Introduction We consider the data of ~1800 phenotype measurements Each mouse has a given probability distribution of descending from one of 8 possible.
Bursts modelling Using WinBUGS Tim Watson May 2012 :diagnostics/ :transformation/ :investment planning/ :portfolio optimisation/ :investment economics/
4-1 Continuous Random Variables 4-2 Probability Distributions and Probability Density Functions Figure 4-1 Density function of a loading on a long,
BINARY LOGISTIC REGRESSION
Jiaping Wang Department of Mathematical Science 04/22/2013, Monday
Chapter 7. Classification and Prediction
Statistical Modelling
Generalized Linear Models
Introducing Bayesian Approaches to Twin Data Analysis
Model Inference and Averaging
Chapter Six Normal Curves and Sampling Probability Distributions
STA 216 Generalized Linear Models
Generalized Linear Models
Types of Poisson Regression. Offset Regression  A variant of Poisson Regression  Count data often have an exposure variable, which indicates the number.
Bayesian Inference for Small Population Longevity Risk Modelling
School of Mathematical Sciences, University of Nottingham.
Jeffrey E. Korte, PhD BMTRY 747: Foundations of Epidemiology II
STA 216 Generalized Linear Models
Predictive distributions
OVERVIEW OF BAYESIAN INFERENCE: PART 1
Jeffrey E. Korte, PhD BMTRY 747: Foundations of Epidemiology II
Presentation transcript:

MCMC for Poisson response models Lecture 16 MCMC for Poisson response models

Lecture Contents Multilevel Poisson Model MCMC Algorithms for Poisson Models MLwiN for Poisson models WinBUGS for Poisson models Comparisons

Multilevel Poisson model The Poisson distribution is used to model count data. It is often used in disease data as an approximation to the Binomial distribution where the exposure (number of trials) is used as an offset variable. In the practical we will look in detail at a veterinary epidemiology dataset on TB cases in animal herds in Canada. Here the response is the number of cases of TB in the period 1985 to 1994 in herds of cattle, cervids and bison. Note that the data contains only herds which were infected in outbreaks of TB and the data has been falsified to meet confidentiality regulations.

Multilevel Poisson Regression A multilevel Poisson regression model can be written as follows: You will notice the offset (log(expij)) which in the TB example is the number of animal days at risk in the group. Including this offset allows comparison of rates rather than number of cases which is more sensible as otherwise the model will simply predict that more cases are seen in herds with more days at risk!

Bayesian Multilevel Poisson model To extent the model into a Bayesian framework we need to include priors for the fixed effects and between herd variance. We will use the standard ‘diffuse’ priors as shown below:

MCMC Algorithm Our MLwiN algorithm has 3 steps: 1. Generate βi by Univariate Normal MH Sampling in MLwiN or Gamerman method in WinBUGS. 2. Generate each uj by Univariate Normal MH Sampling in MLwiN or AR sampling in WinBUGS. 3. Generate 1/σu2 from its Gamma conditional distribution.

A final model for TB-Real ? We will consider here only the following model for the dataset which contains all feasible predictors. The model to the right has been fitted using 1st order MQL estimation. Note: to construct this model you will need to make predictors categorical via the Names window and construct the offset via the Calculate window.

MLwiN MH Estimation Using MH in MLwiN gives the following estimates after 50,000 iterations:

Trajectories plot The (thinned) trajectories are as follows:

WinBUGS code model { # Level 1 definition for(i in 1:N) { reactors[i] ~ dpois(mu[i]) log(mu[i]) <- offs[i] + beta[1] * cons[i] + beta[2] * type_2[i] + beta[3] * type_3[i] + beta[4] * type_5[i] + beta[5] * sex_2[i] + beta[6] * age_1[i] + beta[7] * age_2[i] + u2[farm_id[i]] * cons[i] } # Higher level definitions for (j in 1:n2) { u2[j] ~ dnorm(0,tau.u2) # Priors for fixed effects for (k in 1:7) { beta[k] ~ dflat() } # Priors for random terms tau.u2 ~ dgamma(0.001000,0.001000) sigma2.u2 <- 1/tau.u2 Here we see the use of dpois for a Poisson distribution. Note that when code is generated via MLwiN the offset is always named ‘offs’. Fortunately WinBUGS allows variable names to include the underscore character.

WinBUGS timing comparison WinBUGS took 2 minutes 4 seconds for 55,000 iterations compared with 15 seconds in MLwiN. The chain for the intercept and two worst mixing fixed effects were as follows:

WinBUGS/MLwiN estimates The following estimates were produced: Parameter 1st MQL MLwiN WinBUGS β0 -10.071 -11.231 (-12.96, -9.78) -11.289 (-13.09, -9.68) β1 -0.388 -0.405 (-1.082, 0.289) -0.405 (-1.065, 0.248) β2 -0.412 -0.241 (-1.205, 0.752) -0.238 (-1.219, 0.721) β3 -0.319 -0.250 (-2.019, 1.303) -0.240 (-1.992, 1.322) β4 -0.350 -0.352 (-0.760, 0.053) -0.348 (-0.772, 0.051) β5 2.715 2.873 (1.614, 4.503) 2.919 (1.569, 4.606) β6 2.457 2.626 (1.400, 4.235) 2.671 (1.374, 4.331) σ2u 2.904 2.016 (0.964, 3.883) 2.043 (0.964, 4.029)

Effective sample size comparison Note that the Ratio in ESS figures below have to be balanced by the fact that MLwiN is 124/15 = 8.27 times faster! Parameter MLwiN WinBUGS Ratio β0 66 215 3.26 β1 520 2829 5.44 β2 304 1328 4.37 β3 865 4362 5.04 β4 3666 22521 6.14 β5 77 237 3.08 β6 72 224 3.11 σ2u 3244 15498 4.78

Information for the practical In the final practical of the week you are asked to look at fitting more Poisson models to the tb-real dataset. You can use the DIC for Poisson models in both MLwiN and WinBUGS to find firstly the best single level model and then the best random effects model.