For microsimulations, I (i) want to estimate parameters of an empirical distribution and (ii) draw a random sample based on the estimations. My random variable $Y$ seems to follow a Generalized Beta distribution of the second kind (GB2). The pdf is defined on $\mathbb{R}_+$ by: $$ GB2(y;a,b,p,q) = \frac{|a|y^{ap-1}}{b^{ap}B(p,q)(1+(y/b)^a)^{p+q}} $$
I already estimated the parameters of the Generalized Beta (Second Kind) distribution using the GB2 stata package. Now, I wonder how to draw a random sample using the parameter estimates. What would be the normal procedure to generate random samples in this case?