# poisson-1 - Chapter 1 Poisson-Gamma model 1.1 Introduction...

This preview shows pages 1–3. Sign up to view the full content.

Chapter 1 Poisson-Gamma model 1.1 Introduction In this lesson we study the Poisson-Gamma combination of likelihood and prior. If we have a random sample y 1 , y 2 , ..... , y n where each y i is believed to be generated by a Poisson distribution with parameter θ , and if we consider as prior distribution for θ a Gamma distribution with parameters a , b , then the posterior distribution of θ is also a Gamma with parameters ( a + y i , b + n ). The predictive distribution for a future observation is Negative Binomial with parameters a + y i , b + n . θ Gamma( a , b ) y 1 , y 2 , ..... , y n | θ Poisson( θ ) θ | y 1 , y 2 , ..... , y n Gamma ± a + X y i , b + n ² y n + 1 | y 1 , y 2 , ...... , y n NegBinomial ± a + X y i , b + n ² In this lesson, we want to get acquainted with all these distributions, see what we can obtain from them with R and, along the way, construct the posterior and predictive distributions for θ with R for one example. Please, read section 3.2 of Ho ’s book and these notes as required reading. First, we will review the Poisson distribution and the gamma distribution. 1.2 Review of the Poisson random variable Poisson( θ ) . A discrete random variable Y is said to be a Poisson r.v. with parameter θ if the probability distribution of a single observation y is P ( Y = y | θ ) = ( e - θ θ y y ! for y = 0 , 1 , 2 , .... , n 0 elsewhere (1.1) For such a random variable, E [ Y | θ ] = θ Var [ Y | θ ] = θ Poisson r.v.’s are, for example, counts in areas, volumes or time. For example, we may model the number of ﬂaws in a square yard of textile, the number of bacterial colonies in a cubic centimeter of water, or the number of times a machine fails in the course of a workday. R will not give you the mean and expected value directly. There is not a function for that in R (unless you use simulated data from the Poisson, in which case you would use the mean() function.) 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Stats C180 / C236 Introduction to Bayesian Statistics Juana Sanchez UCLA Department of Statistics Let’s see how we can summarize things of the Poisson distribution with R. Suppose we have a Poisson with θ = 3. ######### Things R can give you from a Poisson(theta=3)####### ############## Obtaining the probabilities for each X value ########### x=seq(0,20,by=1) # create x=0,1,2,. ... x # view x [1] 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 p.x= dpois(x, 3 ) # Find Prob(X=x) for x=0,1,2,. ..... p.x # view p.x [1] 4.978707e-02 1.493612e-01 2.240418e-01 2.240418e-01 1.680314e-01 [6] 1.008188e-01 5.040941e-02 2.160403e-02 8.101512e-03 2.700504e-03 [11] 8.101512e-04 2.209503e-04 5.523758e-05 1.274713e-05 2.731529e-06 [16] 5.463057e-07 1.024323e-07 1.807629e-08 3.012715e-09 4.756919e-10 [21] 7.135379e-11 ########### Plotting the Poisson(theta=3) ########## plot(x,p.x,type="h",ylab="Poisson (theta=3)",main="Poisson distribution (theta=3)") 0 5 10 15 20 0.00 0.05 0.10 0.15 0.20 Poisson distribution (theta=3) x
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 20

poisson-1 - Chapter 1 Poisson-Gamma model 1.1 Introduction...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online