# NOT RUN {
n = 10000
weight = c( 0.6 , 0.3 , 0.1 )
alpha = c( 100 , 200 , 300 )
beta = c( 100/3, 200/4, 300/5 )
data = rmixgamma( n = n, weight = weight, alpha = alpha, beta = beta )
hist( data, prob = TRUE, nclass = 30, col = "gray" )
x = seq( -20, 20, 0.05 )
densmixgamma = dmixnorm( x, weight, alpha, beta )
lines( x, densmixgamma, lwd = 2 )
# }
Run the code above in your browser using DataLab