# NOT RUN {
n = 10000
weight = c( 0.3, 0.5, 0.2 )
df = c( 4 , 4 , 4 )
mean = c( 0 , 10 , 3 )
sd = c( 1 , 1 , 1 )
data = rmixt( n = n, weight = weight, df = df, mean = mean, sd = sd )
hist( data, prob = TRUE, nclass = 30, col = "gray" )
x = seq( -20, 20, 0.05 )
densmixt = dmixt( x, weight, df, mean, sd )
lines( x, densmixt, lwd = 2 )
# }
Run the code above in your browser using DataLab