ASQWorkshoponBayesianStatisticsfor Industry

Similar documents
Bayesian Inference for Regression Parameters

Stat 544 Final Exam. May 2, I have neither given nor received unauthorized assistance on this examination.

Bayesian Estimation An Informal Introduction

Sheppard s Correction for Variances and the "Quantization Noise Model"

Stat 5421 Lecture Notes Proper Conjugate Priors for Exponential Families Charles J. Geyer March 28, 2016

An Elementary Introduction to Some Issues in Metrology and Some Implications of (and for) Probability and Statistics

Statistics in Environmental Research (BUC Workshop Series) II Problem sheet - WinBUGS - SOLUTIONS

Producing Data/Data Collection

Producing Data/Data Collection

CSC 2541: Bayesian Methods for Machine Learning

Sequences and infinite series

Appendix A. Review of Basic Mathematical Operations. 22Introduction

40.2. Interval Estimation for the Variance. Introduction. Prerequisites. Learning Outcomes

BUGS Bayesian inference Using Gibbs Sampling

PATTERN RECOGNITION AND MACHINE LEARNING CHAPTER 2: PROBABILITY DISTRIBUTIONS

Bayesian Models in Machine Learning

Joint, Conditional, & Marginal Probabilities

Regression Analysis IV... More MLR and Model Building

Proving languages to be nonregular

Percent Problems. Percent problems can be solved using proportions. Use the following formula when solving percent problems with a proportion.

CH 59 SQUARE ROOTS. Every positive number has two square roots. Ch 59 Square Roots. Introduction

36-463/663Multilevel and Hierarchical Models

Introduction to Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Physics 509: Error Propagation, and the Meaning of Error Bars. Scott Oser Lecture #10

Tools for Parameter Estimation and Propagation of Uncertainty

An Introduction to Statistical Issues and Methods in Metrology for Physical Science and Engineering

LIMITS AND DERIVATIVES

Section 20: Arrow Diagrams on the Integers

CS 361: Probability & Statistics

Direct Proofs. the product of two consecutive integers plus the larger of the two integers

Assume that you have made n different measurements of a quantity x. Usually the results of these measurements will vary; call them x 1

Multivariate Normal & Wishart

Chapter 8: Sampling distributions of estimators Sections

PARAMETER ESTIMATION: BAYESIAN APPROACH. These notes summarize the lectures on Bayesian parameter estimation.

Bayesian Inference for Normal Mean

Elementary Statistical Methods and Measurement Error

Markov Chain Monte Carlo

Stat260: Bayesian Modeling and Inference Lecture Date: February 10th, Jeffreys priors. exp 1 ) p 2

Introduction to Applied Bayesian Modeling. ICPSR Day 4

STAT 425: Introduction to Bayesian Analysis

Real Analysis Prof. S.H. Kulkarni Department of Mathematics Indian Institute of Technology, Madras. Lecture - 13 Conditional Convergence

Section 4.7 Scientific Notation

1 Hypothesis Testing and Model Selection

Fitting a Straight Line to Data

Bayesian Inference: Concept and Practice

The Normal Linear Regression Model with Natural Conjugate Prior. March 7, 2016

MAT Inverse Problems, Part 2: Statistical Inversion

CSSS/STAT/SOC 321 Case-Based Social Statistics I. Levels of Measurement

An Introduction to Statistical Issues and Methods in Metrology for Physical Science and Engineering

IE 316 Exam 1 Fall 2011

Section 3.1: Direct Proof and Counterexample 1

Department of Statistics

Communication Engineering Prof. Surendra Prasad Department of Electrical Engineering Indian Institute of Technology, Delhi

Confidence intervals

Bayesian Methods for Machine Learning

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

5 + 9(10) + 3(100) + 0(1000) + 2(10000) =

IE 361 Module 18. Reading: Section 2.5 Statistical Methods for Quality Assurance. ISU and Analytics Iowa LLC

Bayesian Computation

Principles of Bayesian Inference

A Bayesian Nonparametric Model for Predicting Disease Status Using Longitudinal Profiles

The Wishart distribution Scaled Wishart. Wishart Priors. Patrick Breheny. March 28. Patrick Breheny BST 701: Bayesian Modeling in Biostatistics 1/11

Number Systems III MA1S1. Tristan McLoughlin. December 4, 2013

Conditional probabilities and graphical models

Slope Fields: Graphing Solutions Without the Solutions

Computational Cognitive Science

WinBUGS : part 2. Bruno Boulanger Jonathan Jaeger Astrid Jullion Philippe Lambert. Gabriele, living with rheumatoid arthritis

Monte Carlo-based statistical methods (MASM11/FMS091)

Power series and Taylor series

The Metropolis-Hastings Algorithm. June 8, 2012

SECTION 3.5: DIFFERENTIALS and LINEARIZATION OF FUNCTIONS

Eco517 Fall 2004 C. Sims MIDTERM EXAM

What is proof? Lesson 1

INTRODUCTION TO SIGMA NOTATION

2. I will provide two examples to contrast the two schools. Hopefully, in the end you will fall in love with the Bayesian approach.

5.2 Infinite Series Brian E. Veitch

27 : Distributed Monte Carlo Markov Chain. 1 Recap of MCMC and Naive Parallel Gibbs Sampling

Bayesian Approach 2. CSC412 Probabilistic Learning & Reasoning

Part 2: One-parameter models

A noninformative Bayesian approach to domain estimation

Cambridge University Press How to Prove it: A Structured Approach: Second edition Daniel J. Velleman Excerpt More information

CS 361 Meeting 26 11/10/17

Recall that the AR(p) model is defined by the equation

IE 361 Module 21. Design and Analysis of Experiments: Part 2

Bayesian Updating: Discrete Priors: Spring

IE 361 Module 4. Modeling Measurement. Reading: Section 2.1 Statistical Methods for Quality Assurance. ISU and Analytics Iowa LLC

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

Outline. Binomial, Multinomial, Normal, Beta, Dirichlet. Posterior mean, MAP, credible interval, posterior distribution

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Intro to Learning Theory Date: 12/8/16

Uncertain Inference and Artificial Intelligence

Predicting AGI: What can we say when we know so little?

Chapter 3. Estimation of p. 3.1 Point and Interval Estimates of p

MFM Practitioner Module: Risk & Asset Allocation. John Dodson. February 3, 2010

Section 4.2: Mathematical Induction 1

An example to illustrate frequentist and Bayesian approches

Math Circles Intro to Complex Numbers Solutions Wednesday, March 21, Rich Dlin. Rich Dlin Math Circles / 27

Main topics for the First Midterm Exam

NONINFORMATIVE NONPARAMETRIC BAYESIAN ESTIMATION OF QUANTILES

Next, we include the several conversion from type to type.

CS395T Computational Statistics with Application to Bioinformatics

Transcription:

ASQWorkshoponBayesianStatisticsfor Industry March 8, 2006 Prof. Stephen Vardeman Statistics and IMSE Departments Iowa State University vardeman@iastate.edu 1 Module 6: Some One-Sample Normal Examples We continue with our illustration of what is possible using WinBUGS to do Bayes analyses, in this module treating some problems involving normal observations with both μ and σ unknown. Example 4 A real example on page 771 of Vardeman and Jobe s Basic Engineering Data Collection and Analysis concerns measurements on a critical dimension of n =5consecutive parts produced on a CNC Lathe. The measurements in units of.0001 in over nominal were 4, 3, 3, 2, 3 We note that the usual sample mean for these values is x =3.0in and the usual sample standard deviation is s =.7071 in. 2 To begin, we re going to first do what most textbooks would do here, and consider analysis of these data under the model that says that the data are realized values of X 1,X 2,...,X 5 independent N ³ μ, σ 2 random variables Standard "Stat 101" confidence limits for the process mean μ are s x ± t n 1 n while confidence limits for the process standard deviation σ are v u st n 1 v u χ 2,st n 1 upper,n 1 χ 2 lower,n 1 and prediction limits for an additional dimension generated by this process, x new,are s x ± t n 1 s 1+ 1 n 3 In the present problem, these yield 95% limits as in Table 1. Table 1 Standard (non-bayesian) 95% Confidence and Prediction Limits Based on a Normal Assumption for the Part Measurements Quantity lower limit upper limit μ 3.0 2.776.7071 =2.12 3.88 q 5 q σ.7071 4 11.143 =.42.7071 4 q.484 =2.03 x new 3.0 2.776 (.7071) 1+ 1 5 =.85 5.15 One of the things that Bayesians try to do is to find relatively "non-informative" priors for which inferences based on their posteriors are in substantial agreement with non-bayes methods of inference for problems where the latter are available. This gives some hope that when such priors are used as parts of 4

more complicated models (some for which no non-bayesian methods of inference are even known) they will give inferences not too heavily affected by the choice of prior. We now consider what are fairly standard choices of priors in one-sample normal problems. A standard "noninformative" choice of prior distribution for a one-sample normal problem is μ "Uniform (, ) " independent of ln (σ) "Uniform (, ) " Strictly speaking this is nonsense, as there is no such thing as a uniform probability distribution on (, ). Precisely what is meant is that with δ =ln(σ) one is using as a "prior" for (μ, δ) a function This turns out to be equivalent to using as a "prior" for ³ μ, σ 2 a function g ³ μ, σ 2 1 σ 2 These don t actually specify a joint probability distribution for ³ μ, σ 2, but can be thought of as approximately equivalent to the "honest" priors or μ Uniform ( large, large) independent of ln (σ) Uniform ( large, large) μ N (0,large) independent of 1 Gamma (small, small) σ2 g (μ, δ) =1 5 WinBUGS allows the use of the "improper" "Uniform(, )" prior through 6 the notation dflat() sigma<-exp(logsigma) tau<-exp(-2*logsigma) The file BayesASQEx4A.odc contains some WinBUGS code for implementing a Bayes analysis for these data based on independent "flat" priors for μ and ln (σ). This is for (i in 1:5) { X[i]~dnorm(mu,tau) Xnew~dnorm(mu,tau) mu~dflat() logsigma~dflat() 7 list(x=c(4,3,3,2,3)) list(mu=7,logsigma=2,xnew=7) 8

list(mu=7,logsigma=-2,xnew=7) list(mu=2,logsigma=2,xnew=2) list(mu=2,logsigma=-2,xnew=2) Then Figure 1 shows the result of running this code in WinBUGS. (I ran 4 chains from the above-indicated initializations and checked that burn-in had occurred by 1000 iterations. What is pictured are then results based on iterations 1001 through 11000.) 9 Figure 1: Posteriors based on n =5normal observations with independent "flat" (improper) priors on μ and ln (σ) 10 Notice that the Bayes results for this "improper prior" analysis are in almost perfect agreement with the "ordinary Stat 101" results listed in Table 1. This analysis says one has the same kind of precision of information about μ, σ, and x new that would be indicated by the elementary formulas. Thecodeforthefirst of these is: The files BayesASQEx4B.odc and BayesASQEx4C.odc contain code that the reader can verify produces results not much different from those above. The priors used in these are respectively μ Uniform ( 10000, 10000) independent of ln (σ) Uniform ( 100, 100) and μ N ³ 0, 10 6 independent of τ = 1 σ 2 Gamma (.01,.01) 11 mu~dunif(-10000,10000) logsigma~dunif(-100,100) sigma<-exp(logsigma) tau<-exp(-2*logsigma) for (i in 1:5) { X[i]~dnorm(mu,tau) 12

Xnew~dnorm(mu,tau) mu~dnorm(0,.000001) list(x=c(4,3,3,2,3)) tau~dgamma(.01,.01) sigma<-sqrt(1/tau) list(mu=7,logsigma=2,xnew=7) for (i in 1:5) { list(mu=7,logsigma=-2,xnew=7) X[i]~dnorm(mu,tau) list(mu=2,logsigma=2,xnew=2) list(mu=2,logsigma=-2,xnew=2) Xnew~dnorm(mu,tau) and the code for the second is 13 list(x=c(4,3,3,2,3)) 14 list(mu=7,tau=1,xnew=7) list(mu=7,tau=.0001,xnew=7) list(mu=2,tau=1,xnew=2) list(mu=2,tau=.0001,xnew=2) The point of providing these last two sets of code is simply that they represent "honest" Bayes analyses with real prior distributions that approximate the improper prior analyses in case a reader is uneasy about the "flat"/"uniform(, )" improper prior idea. A real potential weakness of standard analyses data like those in Example 4 is that they treat what are obviously "to the nearest something" values as if they 15 were exact (infinite number of decimal places) numbers. The "4" in the data set is treated as if it were 4.00000000000... Sometimes this interpretation is adequate, but other times ignoring the "digitalization"/"quantization" of measurement produces inappropriate inferences. This is true when the quantization is severe enough compared to the real variation in what is being measured that only a very few values appear in the data set. This is potentially the case in the real situation of Example 4. The next example revisits the problem, and takes account of the quantization evident in the data. Example 5 Consider a model for the recorded part dimensions that says they are (infinite number of decimal places) normal random variables rounded to the nearest integer (unit of.0001 in above nominal). A cartoon of a possible distribution of the real part dimension and the corresponding distribution of the digital measurement is in Figure 2 16

To model this, we might suppose that real part dimensions are realized values of X 1,X 2,...,X 5 independent N ³ μ, σ 2 random variables butthatdatainhandarey 1,Y 2,...,Y 5 where Y i = the value of X i rounded to the nearest integer Figure 2: Distributions of an actual part dimension and the corresponding quantized value 17 In this understanding, the value Y 1 =4in the data set doesn t mean that the first diameter was exactly 4.000000000... but rather only that it was somewhere between 3.5000000... and 4.500000... What is especially pleasant is that WinBUGS makes incorporating this recognition of the digital nature of measurements into a Bayes analysis absolutely painless. For sake of argument, let us do an analysis with priors μ "Uniform (, ) " independent of ln (σ) "Uniform (, ) " 18 and suppose that of interest are not only the parameters μ and σ, but also an X new from the process and its rounded value Y new, and in addition the fraction of the X distribution below 1.000, that is h ³ μ, σ 2 µ 1.0 μ = Φ σ There are no widely circulated non-bayes methods of inference for any of these quantities. (Lee and Vardeman have written on non-bayesian interval estimation for μ and σ, but these papers are not well-known.) The file BayesASQEx5.odc contains some WinBUGS code for implementing the Bayes analysis. This is logsigma~dflat() sigma<-exp(logsigma) tau<-exp(-2*logsigma) X1~dnorm(mu,tau) I(3.5,4.5) X2~dnorm(mu,tau) I(2.5,3.5) X3~dnorm(mu,tau) I(2.5,3.5) X4~dnorm(mu,tau) I(1.5,2.5) X5~dnorm(mu,tau) I(2.5,3.5) Xnew~dnorm(mu,tau) mu~dflat() 19 Ynew<-round(Xnew) 20

prob<-phi((1.0-mu)/sigma) list(mu=7,logsigma=2,xnew=7,x1=4,x2=4,x3=4,x4=2,x5=3) list(mu=7,logsigma=-2,xnew=7,x1=4,x2=4,x3=4,x4=2,x5=3) list(mu=2,logsigma=2,xnew=2,x1=2,,x1=4,x2=4,x3=4,x4=2,x5=3) list(mu=2,logsigma=-2,xnew=2,,x1=4,x2=4,x3=4,x4=2,x5=3) Figure 3 shows an analysis that results from using this code. 21 Figure 3: Results of a Bayes analysis for n =5part dimensions, treating what is observed as integer-rounded normal variables 22 Perhaps the most impressive part of all this is the ease with which something as complicated as Φ ³ 1.0 μ σ is estimated and some sense of the precision with which it is known is provided... and this taking account of rounding in the data. Note that of the parts of the analysis that correspond to things that were done earlier, it is the estimation of σ that is most affected by recognizing the quantized nature of the data. The posterior distribution here is shifted somewhat left of the one detailed in Figure 1. This is probably a good point to remark on the fact that for a Bayesian, learning is always sequential. Today s posterior is tomorrow s prior. As long as one is willing to say that the CNC turning process that produced the parts is physically stable, the posterior from one of the analyses in this module would be appropriate as a prior for analysis of data at a subsequent point. So, for example, instead of starting with a flat prior for the process mean, μ, anormal distribution with mean near 3.00 and standard deviation near.44 could be considered. 23