If I have a mixture distribution with two normal components like so
wN(\mu_1, \sigma^2_1) + (1 - w)N(\mu_2, \sigma^2_2)
it is relatively simple to calculate the pdf and the cdf of this distribution. I know that the cdf is
F(x) = wF_1(x) + (1-w)F_2(x)
I would like to calculate the inverse cdf F^{-1}(x). I’m able to do this in R using the uniroot
or the optim
function, but how would I go about doing this in stan?