I would like to generated a mix of five Gamma's distribution where r=3, lambda_i=1/i and theta_i= i/15 while i is in {1, 2 , 3, 4, 5}. Later I would like to plot them to show the results.
I performed some code to generate one variable,
n=5000
k=sample(1:5,size=n,replace=TRUE,prob=(1:5)/15)
rate=1/k
x=rgamma(n,shape=3,rate=rate)
But I have no idea what to do next. Should I make a vector containing five variables like this one and plot it?
Here is another way of generating the plot using ggplot2 as you mentioned. A density plot of the five Gamma distributions can be created using ggplot2 in the manner shown here. A density plot of the five Gamma distributions will be produced by this, with each distribution being coloured differently based on the value of k.