demo/Chapter.5.7.R

#########################################################
# Section 5.7 Monte Carlo Method for Computing Integrals
#########################################################

 p=rbeta(1000, 14.26, 23.19)
 est=mean(p^2)
 se=sd(p^2)/sqrt(1000)
 c(est,se)

Try the LearnBayes package in your browser

Any scripts or data that you put into this service are public.

LearnBayes documentation built on May 1, 2019, 7:03 p.m.