How to transform an uniform distribution into a generalized beta 2 distribution using gamlss, fitdist or other?

Not comfortable with math and just R beginner, I get stuck on the following problem:

Imagine that, for a variable ya (n=3000), the gamslss fitDist function selects the GB2 distribution with e.g. mu=2, sigma=4, nu=4, tau=1.

library(gamlss)
ya<- rGB2(3000, mu=2, sigma=4, nu=4, tau=1) #for example
hist(ya,200)


Imagine now a second variable yb (n=800) with an uniform distribution

yb <- runif(800, 0, 20)
hist(yb,200)


Question: What is the easiest way to transform yb so that its uniform distribution becomes similar to the generalized beta 2 distribution from ya, with similar mu, sigma, nu, and tau?

I guess it requires some integration / function (using gamlss, fitdistplus or other?), but I don't know how.

The generic way to solve this problem (converting a set of uniform random deviates to an alternative probability distribution) is to use the inverse cumulative distribution function or quantile function: this is also called inverse transform sampling.

gamlss provides a qGB2() function that plays this role.

In this case we have to scale the uniform variates to (0,1) (dividing by the max value=20) before quantile-transforming:

plot(density(ya))
lines(density(qGB2(yb/20,mu=2, sigma=4, nu=4, tau=1)),col=2)


Bonus: if you look at the code in gamlss::rGB2, you'll see that in fact this is exactly what gamlss does in the first place to generate GB2-distributed variates!

p <- runif(n)
r <- qGB2(p, mu = mu, sigma = sigma, nu = nu, tau = tau)