#STATS: Gibbs Sampling, Sec 7.
#C. Fraser 7/10/99
#Prior Plots
#Generate points from four different beta density curves
bounds <- c(.0001,.9999)
x <- seq(bounds[1],bounds[2],length=1000)
y <- dbeta(x,2,50)
beta.plot2 <- dbeta(x,2,20)
beta.plot3 <- dbeta(x,1,1)
beta.plot4 <- dbeta(x,7,5)
#Plot four different beta priors
plot(x, y, type = "l", xlab = "Prevalence", ylab = "Density")
lines(x,beta.plot2, lty=1)
lines(x,beta.plot3, lty=1)
lines(x,beta.plot4, lty=1)
title("Figure 2. Beta Prior Distributions for Prevalence.")
legend(c(.07, .36), c(13,15), "alpha = 2, beta = 50", bty="n")
legend(c(.11, .40), c(6,8), "alpha = 2, beta = 20", bty="n")
legend(c(.45, .74), c(3.3,5.3), "alpha = 7, beta = 5", bty="n")
legend(c(.83, 1.00), c(1.5,4), c("alpha = 1,", "beta = 1"), bty="n")