## code to accompany the Poisson mass function ## example from lecture 1 of PSTAT 215A, ## Bayesian Inference, UCSB ## ## Robert B. Gramacy adapted from Peter Hoff par(mfrow=c(1,2)) y1 <- 0:10 barplot(dpois(y1, 2.1), names=y1, xlab="y", ylab="p(y|theta=2.1)") y2 <- 0:100 barplot(dpois(y2, 21), names=y2, xlab="y", ylab="p(y|theta=21)")