Down by the Bayes, where the Watermelons Grow

Similar documents
(5) Multi-parameter models - Gibbs sampling. ST440/540: Applied Bayesian Analysis

Principles of Bayesian Inference

Monte Carlo in Bayesian Statistics

Introduction to Bayesian Statistics and Markov Chain Monte Carlo Estimation. EPSY 905: Multivariate Analysis Spring 2016 Lecture #10: April 6, 2016

Bayesian Inference and MCMC

BAYESIAN METHODS FOR VARIABLE SELECTION WITH APPLICATIONS TO HIGH-DIMENSIONAL DATA

Bayesian inference for multivariate extreme value distributions

Advanced Statistical Modelling

Likelihood-free MCMC

Markov Chain Monte Carlo

Markov Chain Monte Carlo, Numerical Integration

MCMC algorithms for fitting Bayesian models

Bayesian Estimation of Input Output Tables for Russia

Markov Chain Monte Carlo methods

Machine Learning for Data Science (CS4786) Lecture 24

LECTURE 15 Markov chain Monte Carlo

Reminder of some Markov Chain properties:

ST 740: Markov Chain Monte Carlo

Bayesian Inference in GLMs. Frequentists typically base inferences on MLEs, asymptotic confidence

Introduction to Machine Learning CMU-10701

MCMC and Gibbs Sampling. Kayhan Batmanghelich

MCMC: Markov Chain Monte Carlo

Bayesian Networks in Educational Assessment

Principles of Bayesian Inference

Lecture 6: Markov Chain Monte Carlo

STA 4273H: Statistical Machine Learning

an introduction to bayesian inference

Example: Ground Motion Attenuation

Markov Chain Monte Carlo

April 20th, Advanced Topics in Machine Learning California Institute of Technology. Markov Chain Monte Carlo for Machine Learning

Bayesian Estimation of DSGE Models 1 Chapter 3: A Crash Course in Bayesian Inference

Who was Bayes? Bayesian Phylogenetics. What is Bayes Theorem?

Bayesian Phylogenetics

Markov Chain Monte Carlo Methods

Bayesian Estimation with Sparse Grids

Bayesian Phylogenetics:


Computational statistics

Infer relationships among three species: Outgroup:

Artificial Intelligence

Advances and Applications in Perfect Sampling

Answers and expectations

Statistical Methods in Particle Physics Lecture 1: Bayesian methods

Doing Bayesian Integrals

(1) Introduction to Bayesian statistics

Forward Problems and their Inverse Solutions

Computer intensive statistical methods

Principles of Bayesian Inference

Bayesian Networks. instructor: Matteo Pozzi. x 1. x 2. x 3 x 4. x 5. x 6. x 7. x 8. x 9. Lec : Urban Systems Modeling

Metropolis-Hastings Algorithm

Bayesian Analysis of RR Lyrae Distances and Kinematics

INTRODUCTION TO BAYESIAN STATISTICS

Stat 535 C - Statistical Computing & Monte Carlo Methods. Lecture February Arnaud Doucet

Computer Vision Group Prof. Daniel Cremers. 11. Sampling Methods

Markov Chain Monte Carlo (MCMC) and Model Evaluation. August 15, 2017

STAT 425: Introduction to Bayesian Analysis

Bayesian model selection in graphs by using BDgraph package

Bayes Nets: Sampling

Bayesian Methods for Machine Learning

CPSC 540: Machine Learning

Parameter Estimation. William H. Jefferys University of Texas at Austin Parameter Estimation 7/26/05 1

Bayesian Inference in Astronomy & Astrophysics A Short Course

Markov chain Monte Carlo

Parameter estimation and forecasting. Cristiano Porciani AIfA, Uni-Bonn

Computer Vision Group Prof. Daniel Cremers. 10a. Markov Chain Monte Carlo

Session 5B: A worked example EGARCH model

Session 3A: Markov chain Monte Carlo (MCMC)

Bayesian Inference for DSGE Models. Lawrence J. Christiano

Bayesian Graphical Models

Pattern Recognition and Machine Learning. Bishop Chapter 11: Sampling Methods

Theory of Stochastic Processes 8. Markov chain Monte Carlo

Bayesian Classification and Regression Trees

Bayesian model selection for computer model validation via mixture model estimation

The Particle Filter. PD Dr. Rudolph Triebel Computer Vision Group. Machine Learning for Computer Vision

CS281A/Stat241A Lecture 22

Approximate Bayesian Computation: a simulation based approach to inference

Computer Vision Group Prof. Daniel Cremers. 14. Sampling Methods

Calibration of Stochastic Volatility Models using Particle Markov Chain Monte Carlo Methods

Contents. Part I: Fundamentals of Bayesian Inference 1

A Bayesian Approach to Phylogenetics

The Metropolis-Hastings Algorithm. June 8, 2012

eqr094: Hierarchical MCMC for Bayesian System Reliability

The Bayesian Choice. Christian P. Robert. From Decision-Theoretic Foundations to Computational Implementation. Second Edition.

Bayesian Model Comparison:

Sampling Methods (11/30/04)

Multivariate Normal & Wishart

STAT 499/962 Topics in Statistics Bayesian Inference and Decision Theory Jan 2018, Handout 01

The lmm Package. May 9, Description Some improved procedures for linear mixed models

Large Scale Bayesian Inference

Bayesian Inference. Chapter 1. Introduction and basic concepts

Package lmm. R topics documented: March 19, Version 0.4. Date Title Linear mixed models. Author Joseph L. Schafer

Bayesian Linear Regression

Likelihood Inference for Lattice Spatial Processes

ComputationalToolsforComparing AsymmetricGARCHModelsviaBayes Factors. RicardoS.Ehlers

SAMPLING ALGORITHMS. In general. Inference in Bayesian models

MARKOV CHAIN MONTE CARLO

Bayesian inference. Fredrik Ronquist and Peter Beerli. October 3, 2007

MCMC and Gibbs Sampling. Sargur Srihari

Bayesian Regression Linear and Logistic Regression

Lecture 13 Fundamentals of Bayesian Inference

Transcription:

Down by the Bayes, where the Watermelons Grow A Bayesian example using SAS SUAVe: Victoria SAS User Group Meeting November 21, 2017 Peter K. Ott, M.Sc., P.Stat. Strategic Analysis 1

Outline 1. Motivating Example 2. Frequentist Approach 3. Bayes Theorem 4. Bayes Approach 5. SAS Implementation 6. Conclusion 2

Example - Soil Disturbance Study random points are generated within the entire area of a cutblock after logging these points fall in the NAR, RWA and excluded areas (e.g. permanent roads) at each point, a soil sample is taken and assessed for disturbance limits/guidelines are different for the RWA, NAR no more than 25% of the RWA can be disturbed no more than 5% of the NAR can be disturbed 3

Sample data: observe n = 91 points in NAR, x = 16 disturbed (18%) Goal: determine whether the licensee is above or below the 5% limit 4

Frequentist Approach calculate θ = x θ 1 θ, var θ = n n 1 sample 80% CI for θ, and the large a lower CI above 5% is evidence of exceeding the limit equivalent to a one sample t-test, testing against a one-sided alternative at α = 0.10 5

Results: θ = 0.18 Classical Frequentist Approach 80% CI: 0.12, 0.23 since 0.12 > 0.05, we conclude that the licensee has exceeded the allowable disturbance limit t obs = 3.14 with p value = 0.0012 since the p value is less than 0.10, we reject H 0 that the true proportion is 5% 6

Likelihood ratio statistic (Λ) is the ratio of maximum likelihoods: Λ x = Prob x θ 0, H 0 Prob x θ 1, H 1 = sup L θ x : θ Θ 0 sup L θ x : θ Θ 1 2log Λ ~ χ ν 2 as n 2log Λ = 18.93, p = 1.36 10 5 7

Bayes Theorem p A B = p A, B p B p B A p A = p B 8

9

Bayes Theorem (cont.) B 0 1 total A 0 20 65 85 1 5 10 15 total 25 75 100 p A = 1 B = 0 = 5 25 = 1 5 p A = 1 B = 0 = p B = 0 A = 1 p A = 1 p B = 0 = 5/15 15/100 25/100 = 5 25 = 1/5 10

Bayes Theorem and Inference p A B = p A, B p B p B A p A = p B p θ x = p x θ p θ p x posterior prob = likelihood prior prob marginal prob of data 11

Back to the Soil Disturbance Example Likelihood: x θ~bin n, θ = p x θ Prior: θ~beta α, β = p θ 12

13

Approach 1: Proc MCMC proc mcmc data=soil_nar seed=178 outpost=post2 nbi=2000 thin=5 nmc=50000 statistics(alpha=0.10 percent=(5,10,25,50,75,90,95))=all; parms p 0.18; model x ~ binomial(n, p); prior p ~ beta(3.32, 129.48); title; run; 14

Output 1.39% of draws are less than the 5% cutoff 15

Markov Chain Monte Carlo (MCMC) class of simulation techniques for recreating (i.e. drawing samples from) probability distributions first order Markov chain is a process (i.e. sequence of states) where the state at time t depends only the previous state a Markov chain with a probability distribution that does not depend on t is called stationary idea is to construct a MC (using random numbers) that leads to the desired stationary distribution 16

Metropolis-Hastings algorithm MCMC (cont.) users supply two distributions: (i) target, and (ii) generating/proposal/jumping (usually symmetric) at each iteration, a candidate value is either accepted (i.e. new fresh value) or rejected (i.e. previous value retained) a candidate value more probable than the existing value (based on (i)) is always accepted a candidate value less probable than the existing value is sometimes accepted, depending on the relative drop in probability for posterior distributions, p x cancels out in algorithm

MCMC (cont.) Gibbs Sampler special case of M-H algorithm specially suited for multivariate posterior distributions explicit form of joint distribution is not required requires conditional distribution of each variable (parameter), with others held fixed 18

Approach 2: Proc FMM proc fmm data=soil_nar seed=123 plots(only)=trace; model x/n = / dist=bin; bayes mupriorparms=(3.32, 129.48) nbi=2000 thin=5 nmc=50000 summaries(alpha=0.10 percent=(5,10,25,50,75,90,95))=all outpost=post; title; run; 19

Output 1.24% of draws are less than the 5% cutoff 20

I neglected to mention Likelihood: x θ~bin n, θ = p x θ Prior: θ~beta α, β = p θ Posterior: p θ x p x θ p θ = p x p x θ p θ = 1 p x θ p θ dθ 0 = Beta α + x, β + n x 21

Approach 3: DIY Datastep data check_nar; set soil_nar; a=3.32; b=129.48; p=x/n; prob_lt05 = cdf('beta', 0.05, x+a, n-x+b); _05_ = quantile('beta', prob_lt05, x+a, n-x+b); keep n x p prob_lt05 _05_; run; 22

Theoretical Posterior Prob Obs n x p prob_lt05 _05_ 1 91 16 0.17582 0.013891 0.05 1.39% of draws are less than the 5% cutoff 23

24

Conclusions Bayesian inference provides the probability of a hypothesis, given observed data arguably more useful for making decisions than frequentist methods the price is the need to assign prior distributions to parameters computational challenges are capably handled in SAS/STAT via Proc Mcmc (general) or the Bayes statement (specific models) 25

Thanks for staying awake! 26