Bayesian Inference. Chapter 2: Conjugate models

Similar documents
Bayesian Inference. Chapter 4: Regression and Hierarchical Models

Module 22: Bayesian Methods Lecture 9 A: Default prior selection

Bayesian Inference. Chapter 4: Regression and Hierarchical Models

7. Estimation and hypothesis testing. Objective. Recommended reading

Conjugate Priors, Uninformative Priors

Bayesian Models in Machine Learning

Estimation of reliability parameters from Experimental data (Parte 2) Prof. Enrico Zio

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

7. Estimation and hypothesis testing. Objective. Recommended reading

Lecture 6. Prior distributions

ABC methods for phase-type distributions with applications in insurance risk problems

Bayesian Learning. HT2015: SC4 Statistical Data Mining and Machine Learning. Maximum Likelihood Principle. The Bayesian Learning Framework

Probability and Estimation. Alan Moses

Part 2: One-parameter models

Fall 2017 STAT 532 Homework Peter Hoff. 1. Let P be a probability measure on a collection of sets A.

Bayesian Inference. Chapter 9. Linear models and regression

Introduction to Probabilistic Machine Learning

2016 SISG Module 17: Bayesian Statistics for Genetics Lecture 3: Binomial Sampling

Stat 5101 Lecture Notes

10. Exchangeability and hierarchical models Objective. Recommended reading

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

Introduc)on to Bayesian Methods

CS 361: Probability & Statistics

Exam 2 Practice Questions, 18.05, Spring 2014

Introduction to Bayesian Statistics

Chapter 4 HOMEWORK ASSIGNMENTS. 4.1 Homework #1

Lecture 3. Univariate Bayesian inference: conjugate analysis

Bayesian Methods for Machine Learning

The binomial model. Assume a uniform prior distribution on p(θ). Write the pdf for this distribution.

Advanced Herd Management Probabilities and distributions

Introduction to Bayesian Methods

18.05 Practice Final Exam

CSC321 Lecture 18: Learning Probabilistic Models

Some slides from Carlos Guestrin, Luke Zettlemoyer & K Gajos 2

Estimation of Quantiles

Class 26: review for final exam 18.05, Spring 2014

The Random Variable for Probabilities Chris Piech CS109, Stanford University

A Very Brief Summary of Bayesian Inference, and Examples

Introduction to Bayesian Methods. Introduction to Bayesian Methods p.1/??

PATTERN RECOGNITION AND MACHINE LEARNING CHAPTER 2: PROBABILITY DISTRIBUTIONS

A Very Brief Summary of Statistical Inference, and Examples

DS-GA 1003: Machine Learning and Computational Statistics Homework 7: Bayesian Modeling

Statistical Inference: Estimation and Confidence Intervals Hypothesis Testing

MAS3301 Bayesian Statistics

Introduction to Applied Bayesian Modeling. ICPSR Day 4

A Discussion of the Bayesian Approach

Bernoulli and Poisson models

Invariant HPD credible sets and MAP estimators

18.05 Final Exam. Good luck! Name. No calculators. Number of problems 16 concept questions, 16 problems, 21 pages

Introduction to Machine Learning

MAS3301 Bayesian Statistics

Principles of Bayesian Inference

Chapter 5. Bayesian Statistics

The Exciting Guide To Probability Distributions Part 2. Jamie Frost v1.1

Statistical Theory MT 2007 Problems 4: Solution sketches

Part III. A Decision-Theoretic Approach and Bayesian testing

Bayesian Inference for Binomial Proportion

Overall Objective Priors

CS 361: Probability & Statistics

(4) One-parameter models - Beta/binomial. ST440/550: Applied Bayesian Statistics

Intro to Bayesian Methods

Monte Carlo-based statistical methods (MASM11/FMS091)

Probability and Statistics Concepts

Module 4: Bayesian Methods Lecture 9 A: Default prior selection. Outline

1 Hypothesis Testing and Model Selection

Mathematical Statistics

Statistical Theory MT 2006 Problems 4: Solution sketches

Foundations of Statistical Inference

Introduction to Bayesian Statistics with WinBUGS Part 4 Priors and Hierarchical Models

Computational Cognitive Science

CSC 2541: Bayesian Methods for Machine Learning

Inference for a Population Proportion

Conjugate Priors: Beta and Normal Spring 2018

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


Time Series and Dynamic Models

Principles of Bayesian Inference

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

Bayesian Inference: Posterior Intervals

(1) Introduction to Bayesian statistics

STAT 425: Introduction to Bayesian Analysis

Lecture 2: Priors and Conjugacy

Hierarchical models. Dr. Jarad Niemi. August 31, Iowa State University. Jarad Niemi (Iowa State) Hierarchical models August 31, / 31

Bayesian inference. Rasmus Waagepetersen Department of Mathematics Aalborg University Denmark. April 10, 2017

TABLE OF CONTENTS CHAPTER 1 COMBINATORIAL PROBABILITY 1

General Bayesian Inference I

Part 4: Multi-parameter and normal models

This does not cover everything on the final. Look at the posted practice problems for other topics.

Non-parametric Inference and Resampling

Bayesian Inference for Regression Parameters

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


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

(3) Review of Probability. ST440/540: Applied Bayesian Statistics

Bayesian Inference. Chapter 1. Introduction and basic concepts

Foundations of Statistical Inference

Part 6: Multivariate Normal and Linear Models

Point Estimation. Vibhav Gogate The University of Texas at Dallas

Principles of Bayesian Inference

Probabilistic modeling. The slides are closely adapted from Subhransu Maji s slides

Transcription:

Bayesian Inference Chapter 2: Conjugate models Conchi Ausín and Mike Wiper Department of Statistics Universidad Carlos III de Madrid Master in Business Administration and Quantitative Methods Master in Mathematical Engineering Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 1 / 40

Objective In this class we study the situations when Bayesian statistics is easy! Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 2 / 40

Conjugate models Yesterday we looked at a coin tossing example. We found that a particular, beta prior distribution lead to a beta posterior. This is an example of a conjugate family of prior distributions. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 3 / 40

Coin tossing problems In coin tossing problems, the likelihood function has the form f (x θ) = cθ x (1 θ) n x where x is the number of observed heads, n is the number of observed tosses and c is a constant determined by the experimental design. Therefore, it is clear that a beta prior f (θ) = implies that the posterior is also beta: 1 B(a, b) θa 1 (1 θ) b 1 f (θ x) θ a+x 1 (1 θ) b+n x 1 = 1 B(a + x, b + n x) θa+x 1 (1 θ) b+n x 1 θ Beta(a + x, b + n x) Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 4 / 40

Advantages of conjugate priors I: simplicity of calculation Using a beta prior in this context has a number of advantages. Given that we know the properties of the beta distribution, prior to posterior inference is equivalent to changing of parameter values. Prediction is also straightforward in the same way. If θ Beta(a, b) and X θ Binomial(n, θ), then ( ) n B(a + x, b + n x) x P(X = x) = B(a, b) for x = 0,..., n. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 5 / 40

Advantages of conjugate priors II: interpretability We can see that a (b) in the prior plays the same role as x (n x). Therefore we can think of the information represented by the prior as equivalent to the information in n tosses of the coin with x heads and n x tails. This gives one way of thinking about how to elicit sensible values for a and b. To how many tosses of a coin and how many heads does my prior information equate? A problem is that people are often overconfident. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 6 / 40

Prior elicitation The previous method is a little artificial. If we are asking a real expert to provide information it is better to ask questions about observable quantities. For example: What would be the average number of heads to occur in 100 tosses of the coin? What about the standard deviation? Then assuming a beta prior, we can solve a µ = 100 a + b ab σ = 100 (a + b)(a + b + 1) Many people don t understand means and standard deviations so it could be even better to ask about modes or medians or quartiles. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 7 / 40

Haldane s prior Recalling the role of a and b also gives a reasonable way of defining a default, non-informative prior by letting a, b 0. In this case we have a prior distribution f (θ) 1 θ(1 θ) for 0 < θ < 1 and the posterior is θ x Beta(x, n x), with mean E[θ x] = x n = ˆθ, the MLE. This prior is improper! Should we care? What if we only observe a sample of heads (tails)? Then the posterior would be improper too! This is a big problem in modern Bayesian statistics. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 8 / 40

Other ways of choosing a default objective prior Given the Principle of Insufficient Reason we saw yesterday, a uniform prior seems a natural selection. However, if we know nothing about θ, shouldn t we also know nothing about ϑ = log for example? θ 1 θ If θ Uniform(0, 1), then the laws of probability imply that the density of ϑ is which is clearly not uniform. f (ϑ) = e ϑ (1 + e ϑ ) 2 Uniform priors are sensible as default options for discrete variables but here, it is not so clear. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 9 / 40

Jeffreys prior Let X θ f ( θ). Then the Jeffreys prior is f (θ) I (θ) [ ] d where I (θ) = E 2 X dθ log f (X θ) is the expected Fisher information. 2 Let X θ Binomial(n, θ). Then the Jeffreys prior is θ Beta ( 1 2, 1 2). Let X θ Negative Binomial(r, θ). The Jeffreys prior is f (θ) 1 θ(1 θ) 1/2. The prior depends on the experimental design. This doesn t comply with the stopping rule principle! There is no truly objective prior! Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 10 / 40

Example The following plot gives the posterior densities of θ for our coin tossing example given the Haldane (blue), uniform (green), Jeffreys I (red) and Jeffreys II (brown) priors. 0.0 0.5 1.0 1.5 2.0 2.5 3.0 f 0.0 0.2 0.4 0.6 0.8 1.0 theta Posterior means for θ are 0.75, 0.714, 0.731 and 0.72 respectively. In small samples the prior can make a (small) difference... Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 11 / 40

Example 0 10 20 30 40 50 f 0.40 0.45 0.50 0.55 0.60 theta... but in our Chinese babies example, it is impossible to differentiate between the posteriors and the posterior means are all equal to 0.5254 to 4 d.p. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 12 / 40

Advantages of conjugate priors III: mixtures are still conjugate A single beta prior might not represent prior beliefs well. A mixture of k (sufficiently many) betas can. The posterior is still a mixture of k betas. Suppose we set f (θ) = 0.5Beta(5, 5) + 0.5Beta(8, 1) in the coin tossing problem of yesterday. Then, given the observed data, we have f (θ x) ] θ 9 (1 θ) [0.5 3 1 B(5, 5) θ5 1 (1 θ) 5 1 1 + 0.5 B(8, 1) θ8 1 (1 θ) 1 1 1 B(5, 5) θ14 1 (1 θ) 8 1 1 + 0.5 B(8, 1) θ17 1 (1 θ) 11 1 where w = = wbeta(14, 8) + (1 w)beta(17, 11) B(14,8)/B(5,5) B(14,8)/B(5,5)+B(17,11)/B(8,1). Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 13 / 40

Example The plot shows the prior (black), scaled likelihood (blue) and posterior (red) density. 0 1 2 3 4 f 0.0 0.2 0.4 0.6 0.8 1.0 theta Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 14 / 40

When do conjugate priors exist? Conjugate priors are associated with exponential family distributions. f (x θ) = C(x)D(θ) exp ( E(x) T F(θ) ) A conjugate prior is then Given a sample of size n, f (θ) D(θ) a exp(b T F(θ)) f (θ x) D(θ) a+n exp((b + nē) T F(θ)) where Ē = 1 n n i=1 E(x i) is the vector of sufficient statistics. Letting a, b 0 gives a natural, objective prior. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 15 / 40

Rare events models Consider models associated with rare events (Poisson process). The likelihood function takes the form: f (x θ) = cθ n e xθ where n represents the number of events to have occurred in a time period of length x and c depends on the experimental design. Therefore, a gamma distribution θ Gamma(a, b), that is f (θ) = ba Γ(a) θa 1 e bθ for 0 < θ < is conjugate. The posterior distribution is then θ x Gamma(a + n, b + x). Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 16 / 40

The information in the prior is easily interpretable: a represents the prior equivalent of the number of rare events to occur in a time period of length b. Letting a, b 0 gives the natural default prior f (θ) 1 θ. (This is the Jeffreys prior for exponential data but not for Poisson data). In this case, given n observed events in time x, the posterior is θ x Gamma(n, x), with mean n x which is equal to the MLE in experiments of this type. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 17 / 40

f Example: Software failure data The CSIAC database provides data showing the times between 136 successive software failures. The diagram shows a histogram of the data and a classical, plug in estimator (blue) of the predictive distribution of x as well as the Bayesian posterior given a Jeffreys prior (red). The Bayesian and classical predictors are indistinguishable. 0.0000 0.0004 0.0008 0.0012 0 1000 2000 3000 4000 5000 6000 x Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 18 / 40

Example: Inference for a queueing system The M/M/1 queuing system assumes arrivals occur according to a Poisson process with rate λ. There is a single server. Service occurs on a first come first served basis. Service times are exponential with mean service time 1/µ. The system is stable if ρ = λ µ < 1. In this case, the equilibrium distribution of the number of people in the system, N, is geometric: N Geometric(1 ρ). Time spent in the system by an arriving customer, W Exponential(µ λ). Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 19 / 40

Example Hall (1991) provides collected inter-arrival and service time data for 98 users of an automatic teller machine in Berkeley, California. We shall assume that the interarrival times and service times both follow exponential distributions. The sufficient statistics were n a = n s = 98 and x a = 119.71 and x s = 81.35 minutes. Given default priors for λ, µ, the posterior distributions are λ x Gamma(98, 119.71) µ x Gamma(98, 81.35). Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 20 / 40

It is easy to calculate the posterior probability that the system is stable...... remembering that the ratio of two χ 2 distributions divided by their degrees of freedom is F distributed. ( 119.71 P(ρ < 1 x) = P = P ) 81.35 x ) 81.35 ρ < 119.71 ( F196 196 < 119.71 81.35 = 0.9965. Given this is so high, it makes sense to consider the equilibrium distributions. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 21 / 40

p 0.00 0.10 0.20 0.30 0 5 10 15 20 n F 0.0 0.2 0.4 0.6 0.8 1.0 0 5 10 15 20 w Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 22 / 40

Normal models Consider a sample from a normal distribution X µ, σ Normal ( µ, σ 2). The likelihood function is ( f (x µ, σ) σ n 2 exp 1 [ (n 1)s 2 2σ 2 + n( x µ) 2] ) Rewrite in terms of the precision, τ = 1 σ 2. Then ( f (x µ, τ) τ n 2 exp τ [ (n 1)s 2 + n( x µ) 2]) 2 Define f (µ, τ) = f (τ)f (τ µ) and assume τ Gamma ( a 2, ) b 2 and µ τ Normal ( ) m, 1 cτ. The marginal distribution of µ is a (scaled, shifted) Student s t. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 23 / 40

A posteriori, we have ( ) cm + n x µ τ, x Normal c + n, 1 (c + n)τ ( a + n τ Gamma 2, b + (n 1)s2 + cn 2 c+n ) (m x)2 The conditional posterior precision is the sum of prior precision (cτ) and precision of the MLE (nτ). The posterior mean is a weighted average of the prior mean (m) and the MLE ( x). A default prior is obtained by letting a, b, c 0 which implies f (µ, τ) 1 τ and ( ) 1 µ τ, x Normal x, nτ ( ) n 1 (n 1)s2 τ x Gamma, 2 2 Then µ x s/ n x Student s t n 1 (boring) Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 24 / 40

One sample example The normal core body temperature of a healthy adult is supposed to be 98.6 degrees Fahrenheit or 37 degrees Celsius on average. A normal model for temperatures, say X µ, τ Normal(µ, 1/τ), has been proposed. Mackowiak et al (1992) measured the core body temperatures of 130 individuals with mean. The sample mean temperature is x = 98.2492 Fahrenheit with standard deviation s = 0.7332. Thus, a classical 95% confidence interval for µ is 98.2492 ± 1.96 0.7332/ 130 = (98.1232, 98.3752) and the hypothesis that the true mean is equal to 98.6 is rejected. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 25 / 40

Consider a prior for µ centred on 98.6, for example µ τ Normal(98.6, 1/τ) with f (τ) 1/τ. The posterior mean for µ is 98.2519 Fahrenheit and a 95% credible interval is (98.1251, 98.3787) so that there still appears to be evidence against the hypothesis. Also, the classical plug in density for X (blue) and the Bayesian posterior predictive density (red) are almost identical. 0.0 0.1 0.2 0.3 0.4 0.5 0.6 f 96 97 98 99 100 101 x Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 26 / 40

An odd feature of the conjugate prior The model precision and the prior precision of the distribution of µ are both proportional to the model precision, τ. This may be restrictive and unrealistic in practical applications. A more natural prior for µ might be Normal ( m, 1 c ) independent of τ. Then, the joint posterior distribution looks nasty. ( f (µ, τ x) τ a+n 2 1 exp τ [ b + (n 1)s 2 + n( x µ) 2] c [µ m]2) 2 2 What can we do? Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 27 / 40

In our problem, both conditional posterior distributions are available: ( ) cm + nτ x 1 µ τ, x Normal, c + nτ (c + nτ) ( a + n τ µ, x Gamma 2, b + (n 1)s2 + n( x µ) 2 ) 2 Both these distributions are straightforward to sample from. Can we use this to give a Monte Carlo sample from the posterior? Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 28 / 40

Introduction to Gibbs sampling A Gibbs sampler is a technique for sampling a multivariate distribution when it is straightforward to sample from the conditionals. Assume that we have a distribution f (θ) where θ = (θ 1,..., θ k ). Let θ i represent the remaining elements of θ when θ i is removed. Assume that we can sample from θ i θ i. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 29 / 40

The Gibbs sampler The Gibbs sampler proceeds by starting from (arbitrary) initial values and successively sampling the conditional distributions. ( 1 Set initial values θ (0) = 2 For i = 1,..., k: 1 Generate θ (t+1) i 2 Set θ (t) = θ (t+1) i 3 t = t + 1 4 Go to 2. θ i θ (t) θ (t) i. i. θ (0) 1,..., θ(0) k ). Set t = 0. As t, the sampled values approach a simple Monte Carlo sample from f (θ). Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 30 / 40

f The example revisited Consider now that we use independent priors, µ Normal(98.6, 1) f (τ) 1 τ Then an estimated 95% posterior interval for µ, based on a sample of size 10000 is (98.1222, 98.3789), very similar to the previous case. The diagram shows the estimated posterior density (green) and the posterior given the conjugate prior (red). 0 1 2 3 4 5 6 7 Both densities are very similar. 98.0 98.1 98.2 98.3 98.4 98.5 mu Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 31 / 40

Two samples: the Behrens Fisher problem For most simple one and two sample problems, when the usual default prior for µ, τ is used, posterior means and intervals for µ coincide with their frequentist counterparts. An exception is the following two sample problem: Consider the model X µ 1, τ 1 N ) ) (µ 1, 1τ1, Y µ 2, τ 2 N (µ 2, 1τ2 with priors f (µ i, τ i ) 1 τ i and independent samples of size n i for i = 1, 2. Then, and similarly for µ 2. Therefore, if δ = µ 1 µ 2, we have µ 1 x s 1 / n 1 Student s t(n 1 1) δ = x ȳ + s 1 n1 T 1 s 2 n2 T 2 Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 32 / 40

The distribution of δ is a scaled, shifted difference of two Student s t variables. Quantiles,... can be calculated to a given precision by e.g. Monte Carlo. Writing δ = δ/ gives δ = sin wt 1 + cos wt 2 where s 2 1 n 1 + s2 1 n 1 w = tan 1 s 1/ n 1 s 2/ n 2, a Behrens Fisher distribution. This problem is difficult to solve classically. Usually a t approximation to the sampling distribution of δ is used, but... the quality of the approximation depends on the true variance ratio. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 33 / 40

f Example Returning to the normal body temperature example, the histograms indicate there may be a difference between the sexes. Men Women 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.0 0.1 0.2 0.3 0.4 0.5 0.6 f 96 97 98 99 100 101 x 96 97 98 99 100 101 x The sample means are 98.1046 and 98.3939 respectively. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 34 / 40

An approximate 95% confidence interval for the mean difference is ( 0.5396, 0.03881) suggesting that the true mean for women is higher than that for men. Using the Bayesian approach as earlier (based on 10000 simulated values), we have an estimate of the posterior density of δ. 0.0 0.5 1.0 1.5 2.0 2.5 3.0 f 0.8 0.6 0.4 0.2 0.0 0.2 A Bayesian 95% credible interval is estimated as ( 0.5448, 0.0368). delta Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 35 / 40

Multinomial models The multinomial distribution is the extension of the binomial distribution to dice throwing problems. Assume a dice with k faces and probability θ i for face i is thrown n times. Let X be a k 1 vector such that X i is the number of times face i occurs. Then P(X = x θ) = x! k i=1 x i! k i=1 θ x i i, where x = (x 1,..., x k ), x i Z + and k i=1 x i = n and 0 θ i 1, k i=1 θ i = 1. Consider a Dirichlet prior, θ Dirichlet(a), where a = (a 1,..., a k ) and a i > 0. f (θ) = Γ( k i=1 a i) k k i=1 Γ(a θ a i 1 i. i) Then θ x Dirichlet (a + x). i=1 Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 36 / 40

Example After the recent abdication of the King of Spain in favour of his son, 20minutos.es launched a survey asking whether this was the correct decision, (X 1 = 3698 votes) whether the King should have waited longer (X 2 = 347) or whether he should have considered other options such as a referendum (X 3 = 2446). 1 Let θ = (θ 1, θ 2, θ 3 ) and assume a Dirichlet (1/2, 1/2, 1/2) prior. The posterior distribution is Dirichlet(3698.5, 347.5, 2446.5). Consider the difference θ 1 θ 3, reflecting (?) the difference between Monarchists and Republicans. We have E[θ 1 θ 3 x] = 0.193. 0 5 10 15 20 25 30 35 f 0.14 0.16 0.18 0.20 0.22 0.24 theta1 theta3 1 Votes at 12:30 on 5th May 2014. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 37 / 40

The Dirichlet process prior Sometimes, we do not wish to assume a parametric model for the data generating distribution. How can we do this in a Bayesian context? Assume X F F and define a Dirichlet process prior for F. If the support of X is C, then for any partition, C = C 1 C 2... C k and k N, we suppose that (F (C 1 ), F (C 2 ),..., F (C k )) Dirichlet (af 0 (C 1 ), af 0 (C 2 ),..., af 0 (C k )) where a > 0 and F 0 is a baseline, prior mean c.d.f. We write F Dirichlet process(a, F 0 ). Given a sample, x 1,..., x n, we have F x Dirichlet process where ˆF is the empirical c.d.f. ( a + n, af 0 + nˆf a + n The posterior mean is a weighted average of the empirical c.d.f. and the prior mean. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 38 / 40 )

Example The following plot shows the prior (green), posterior (red), empirical (blue) and true (black) c.d.f.s when 20 data were generated from a Beta(2,1) distribution and a Dirichlet process prior with a = 5 and F 0 a uniform distribution were used. F 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 x Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 39 / 40

Summary and next chapter In this chapter we have illustrated the basic properties of conjugate models. When these exist, they allow for simple interpretation and straightforward inference. Unfortunately, conjugate priors do not always exist, for example if data are t or F distributed. Then we need numerical techniques like Gibbs sampling. We study these in more detail in the next chapter. Conchi Ausín and Mike Wiper Conjugate models Masters Programmes 40 / 40