#############################################################################
# EXAMPLE 1: Inverse gamma distribution
#############################################################################
# prior sample size of 100 and prior variance of 1.5
n0 <- 100
var0 <- 1.5
# 100 random draws
y1 <- rinvgamma2( n=100 , n0 , var0 )
summary(y1)
graphics::hist(y1)
# density y at grid x
x <- base::seq( 0 , 2 , len=100 )
y <- dinvgamma2( x , n0 , var0 )
graphics::plot( x , y , type="l")
Run the code above in your browser using DataLab