Bursts modelling Using WinBUGS Tim Watson May 2012 :diagnostics/ :transformation/ :investment planning/ :portfolio optimisation/ :investment economics/

Slides:



Advertisements
Similar presentations
Introduction to Monte Carlo Markov chain (MCMC) methods
Advertisements

Other MCMC features in MLwiN and the MLwiN->WinBUGS interface
What I am after from gR2002 Peter Green, University of Bristol, UK.
INTRODUCTION TO MACHINE LEARNING Bayesian Estimation.
Latent Variable and Structural Equation Models: Bayesian Perspectives and Implementation. Peter Congdon, Queen Mary University of London, School of Geography.
Bayesian Estimation in MARK
1 SSS II Lecture 1: Correlation and Regression Graduate School 2008/2009 Social Science Statistics II Gwilym Pryce
Markov-Chain Monte Carlo
Regression Analysis Using Excel. Econometrics Econometrics is simply the statistical analysis of economic phenomena Here, we just summarize some of the.
2005 Hopkins Epi-Biostat Summer Institute1 Module 2: Bayesian Hierarchical Models Francesca Dominici Michael Griswold The Johns Hopkins University Bloomberg.
Maximum Likelihood We have studied the OLS estimator. It only applies under certain assumptions In particular,  ~ N(0, 2 ) But what if the sampling distribution.
Nemours Biomedical Research Statistics April 2, 2009 Tim Bunnell, Ph.D. & Jobayer Hossain, Ph.D. Nemours Bioinformatics Core Facility.
Linear and generalised linear models Purpose of linear models Least-squares solution for linear models Analysis of diagnostics Exponential family and generalised.
Chapter 12 Section 1 Inference for Linear Regression.
Department of Geography, Florida State University
Prediction concerning Y variable. Three different research questions What is the mean response, E(Y h ), for a given level, X h, of the predictor variable?
Overview G. Jogesh Babu. Probability theory Probability is all about flip of a coin Conditional probability & Bayes theorem (Bayesian analysis) Expectation,
STATISTICS: BASICS Aswath Damodaran 1. 2 The role of statistics Aswath Damodaran 2  When you are given lots of data, and especially when that data is.
2006 Hopkins Epi-Biostat Summer Institute1 Module 2: Bayesian Hierarchical Models Instructor: Elizabeth Johnson Course Developed: Francesca Dominici and.
Introduction to WinBUGS Olivier Gimenez. A brief history  1989: project began with a Unix version called BUGS  1998: first Windows version, WinBUGS.
Introduction to MCMC and BUGS. Computational problems More parameters -> even more parameter combinations Exact computation and grid approximation become.
Priors, Normal Models, Computing Posteriors
A Beginner’s Guide to Bayesian Modelling Peter England, PhD EMB GIRO 2002.
WinBUGS Demo Saghir A. Bashir Amgen Ltd, Cambridge, U.K. 4 th January 2001.
A Comparison of Two MCMC Algorithms for Hierarchical Mixture Models Russell Almond Florida State University College of Education Educational Psychology.
Multilevel Modeling Software Wayne Osgood Crime, Law & Justice Program Department of Sociology.
Tomas Radivoyevitch · David G. Hoel. Biologically-based risk estimation for radiation-induced chronic myeloid leukemia. Radiat Environ Biophys (2000) 39:153–159.
Univariate Linear Regression Problem Model: Y=  0 +  1 X+  Test: H 0 : β 1 =0. Alternative: H 1 : β 1 >0. The distribution of Y is normal under both.
Three Frameworks for Statistical Analysis. Sample Design Forest, N=6 Field, N=4 Count ant nests per quadrat.
Model Selection and Validation. Model-Building Process 1. Data collection and preparation 2. Reduction of explanatory or predictor variables (for exploratory.
Generalized linear MIXED models
Latent Class Regression Model Graphical Diagnostics Using an MCMC Estimation Procedure Elizabeth S. Garrett Scott L. Zeger Johns Hopkins University
The generalization of Bayes for continuous densities is that we have some density f(y|  ) where y and  are vectors of data and parameters with  being.
Tomas Radivoyevitch · David G. Hoel. Biologically-based risk estimation for radiation-induced chronic myeloid leukemia. Radiat Environ Biophys (2000) 39:153–159.
Item Parameter Estimation: Does WinBUGS Do Better Than BILOG-MG?
How does Biostatistics at Roche typically analyze longitudinal data
1 Getting started with WinBUGS Mei LU Graduate Research Assistant Dept. of Epidemiology, MD Anderson Cancer Center Some material was taken from James and.
Anders Nielsen Technical University of Denmark, DTU-Aqua Mark Maunder Inter-American Tropical Tuna Commission An Introduction.
1 Spatial assessment of deprivation and mortality risk in Nova Scotia: Comparison between Bayesian and non-Bayesian approaches Prepared for 2008 CPHA Conference,
Lecturer: Ing. Martina Hanová, PhD.. Regression analysis Regression analysis is a tool for analyzing relationships between financial variables:  Identify.
JAGS & Bayesian Regression. A new approach to insight Pose question and think of the answer needed to answer it. Ask: How do the data arise? What is the.
JAGS. Learning Objectives Be able to represent ecological systems as a network of known and unknowns linked by deterministic and stochastic relationships.
Hierarchical models. Hierarchical with respect to Response being modeled – Outliers – Zeros Parameters in the model – Trends (Us) – Interactions (Bs)
Overview G. Jogesh Babu. R Programming environment Introduction to R programming language R is an integrated suite of software facilities for data manipulation,
Asset Information Quality Handbook Handbook for the management of Asset information Quality Draft E :diagnostics/ :transformation/ :investment planning/
Hierarchical Models. Conceptual: What are we talking about? – What makes a statistical model hierarchical? – How does that fit into population analysis?
Prediction and Missing Data. Summarising Distributions ● Models are often large and complex ● Often only interested in some parameters – e.g. not so interested.
Chapter 20 Linear and Multiple Regression
Regression Analysis AGEC 784.
CHAPTER 3 Describing Relationships
Module 2: Bayesian Hierarchical Models
Correlation and Simple Linear Regression
Introducing Bayesian Approaches to Twin Data Analysis
Chapter 11: Simple Linear Regression
Linear Mixed Models in JMP Pro
Analyzing Redistribution Matrix with Wavelet
Generalized Linear Models
School of Mathematical Sciences, University of Nottingham.
Statistical Methods For Engineers
Predictive distributions
Prepared by Lee Revere and John Large
CHAPTER 3 Describing Relationships
Where did we stop? The Bayes decision rule guarantees an optimal classification… … But it requires the knowledge of P(ci|x) (or p(x|ci) and P(ci)) We.
1/18/2019 ST3131, Lecture 1.
BEC 30325: MANAGERIAL ECONOMICS
BEC 30325: MANAGERIAL ECONOMICS
Statistical Models for the Analysis of Single-Case Intervention Data
Yalchin Efendiev Texas A&M University
Correlation and Simple Linear Regression
Correlation and Simple Linear Regression
Presentation transcript:

Bursts modelling Using WinBUGS Tim Watson May 2012 :diagnostics/ :transformation/ :investment planning/ :portfolio optimisation/ :investment economics/ :regulation and economics/ :training/

Page : 2 © ICS Consulting Ltd 2012 Bayesian analysis software Using Gibbs Sampling for Windows. DoodleBugs – a graphical directed acyclic graph (DAG) Many add-ons, utilities, and variations of the package are also available (e.g. GeoBUGS-for spatial modelling, and PKBUGS-for pharmacokinetic) Can be run from other software packages, e.g. R. library(R2WinBUGS) Connecting to data Business as usual What is WinBUGS?

Page : 3 © ICS Consulting Ltd 2012 Exploratory Data Analysis Linear Model Log-Linear Model Maybe some non-linearity?

Page : 4 © ICS Consulting Ltd 2012 Define the model Load the data Specify the number of MCMC chains Compile the model Load values to initialise the algorithm Update the MCMC Sample parameters of interest Running a statistical model in WinBUGS

Page : 5 © ICS Consulting Ltd 2012 Note: WinBUGS uses precision instead of variance to specify a normal distribution! Model 1 Linear Regression in WinBUGS model { #specify likelihood for( i in 1 : N ) { Bursts[i] ~ dnorm(mu[i],tau) } for( i in 1 : N ) { mu[i] <- alpha + beta * frost[i] } #specify priors alpha ~ dnorm( 0.0,1.0E-6) beta ~ dnorm( 0.0,1.0E-6) tau ~ dgamma(0.001,0.001) sigma <- sqrt(1 / tau) }

Page : 6 © ICS Consulting Ltd 2012 Results R output Estimate Std. Error t value Pr(>|t|) (Intercept) < 2e-16 *** Nr.Air.Frost.Days e-09 ***

Page : 7 © ICS Consulting Ltd 2012 Model 2 Poisson Regression in WinBUGS model { for( i in 1 : N ) { Bursts[i] ~ dpois(mu[i]) } for( i in 1 : N ) { log(mu[i]) <- alpha + beta * frost[i] } alpha ~ dnorm( 0.0,1.0E-6) beta ~ dnorm( 0.0,1.0E-6) } R output Estimate Std. Error z value Pr(>|z|) (Intercept) <2e-16 *** Nr.Air.Frost.Days <2e-16 ***

Page : 8 © ICS Consulting Ltd 2012 Real word data (missing data) - Model 2b Missing data are easily handled Missing observations are treated as unknown parameters Missing values are denoted by “NA” Missing responses are no problem; they are simply estimated A missing explanatory variable must either be replaced, or else given some prior distribution Elicitation model; { for( i in 1 : N ) { Bursts[i] ~ dpois(mu[i]) } for( i in 1 : N ) { log(mu[i]) <- alpha + beta * frost[i] } alpha ~ dnorm( 0.0,1.0E-6) beta ~ dnorm( 0.0,1.0E-6) frost[1]~dunif(0,20) frost[2]~dunif(0,20) frost[4]~dunif(0,20) } list(Bursts = c(581, 504, NA, 403, 395, 484, 531, 338, 599, 611, 396, 1038, 990, 887, 722, 446, 510, 666, NA, 453, 300, 435, 532, NA, 1433, 626, 792, 499, 339, 247, 646, 367, 494, 372, 752, 924, 781, 599, 482, 438, 570, 533, 494, 715, 555, 370, 614, 524, 501, 851, 472), frost = c(NA, NA, 5.7, NA, 0.1, 0.1, 0, 0, 0, 2, 3.8, 15.3, 14.8, 11, 6.3, 2.5, 0.1, 0, 0, 0, 0, 0.9, 0.5, 13.2, 18.9, 15.4, 12.3, 5.1, 2.3, 0, 0, 0, 0.2, 2.7, 9.4, 23.1, 15.2, 3.8, 9.9, 0.3, 0.2, 0.2, 0, 0, 0, 0.4, 1.1, 4.1, 7.8, 11.1, 2.8 ),N=51)

Page : 9 © ICS Consulting Ltd 2012 Poisson Regression with some Missing observations in WinBUGS Frost missingBursts missing frost =c(4.1,10.1,5.8) burst=c(504,664,1433)

Page : 10 © ICS Consulting Ltd 2012 Month effect - Model 4

Page : 11 © ICS Consulting Ltd 2012 BUGS language quite straightforward to learn. Doodle Bugs even easier. Handles missing data easily. Very fast especially when the initialising values are closer to the stationary distribution. Can fit a wide variety of statistical models. Convenient in running multiple MCMC chains. Automated in R and other tools (including Excel) library(R2WinBUGS) library(Rexcel) Why WinBUGS?

Page : 12 © ICS Consulting Ltd 2012 Need to understand what you are doing Saving the data in the appropriate format can be very challenging especially large data set. Algorithm can easily crash especially when priors are not well specified or due to unrealistic initialising values. Algorithm can be very slow especially when dealing with hierarchical model. Needs to know the model to be fitted as every distribution have to be defined. Negatives about WinBUGS

Page : 13 © ICS Consulting Ltd 2012 Limitation in plotting capability. Learning BUGS syntax (though very similar to other packages such as R, S-PLUS). Using extreme priors especially non-informative priors can cause the algorithm to crash. Challenges with WinBUGS