https://github.com/cran/LearnBayes
Tip revision: 807bc1c85328bf5bfbcc356cfd27080adf54a05b authored by Jim Albert on 18 March 2018, 19:41:13 UTC
version 2.15.1
version 2.15.1
Tip revision: 807bc1c
Chapter.7.5.R
########################################################
# Section 7.5 Modeling a Prior Belief of Exchangeability
########################################################
library(LearnBayes)
pgexchprior=function(lambda,pars)
{
alpha=pars[1]; a=pars[2]; b=pars[3]
(alpha-1)*log(prod(lambda))-(2*alpha+a)*log(alpha*sum(lambda)+b)
}
alpha=c(5,20,80,400); par(mfrow=c(2,2))
for (j in 1:4)
mycontour(pgexchprior,c(.001,5,.001,5),c(alpha[j],10,10),
main=paste("ALPHA = ",alpha[j]),xlab="LAMBDA 1",ylab="LAMBDA 2")