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.