Sampling from weighted sum distribution

301 Views Asked by At

I have $n$ probability density functions $p_1, \ldots, p_n$, which I am able to sample from. How to sample from a weighted sum of these PDFs $$c_1 p_1+ \cdots+c_n p_n$$ given that $c_1+ \cdots+c_n=1$? Is is correct to randomly pick one of these PDFs with probability equal to the respective weight and just directly sample the chosen PDF?