Part of my project requires that I do some sampling and although I can find some answers, i find my questions to be rather basic ( like sampling from a truncated normal or sampling from a marginal distribution). I could find answers here, but I feel that it should be easy to find an answer to such questions in a book, but it seems that there is no such thing. I can't find any theory properly written!
My question is, can I find such a book/ pdf lecture, and if yes, where :)?
Edit: Some context to better understand my question:
A couple days ago, I wondered how to sample from a marginal distribution $f_X(x) = \int f(x|y) f(y) dy$, I asked around, got an answer, but they weren't able to explain why it worked ( sample from y plug y in the conditional, keep the x) , and it sort of makes sense but i can't justify it, and it happened to me before that when it comes to sampling, no one can give much more than recipes. And i would like to know where i can find how to "prove" it.
Thank you :)