# Is there a way to generate a sample $(X_i, Y_i, Z_i)$ from custom distribution?

I'm newbie here.

I'm wondering if it's possible to generate $$(X_i, Y_i, Z_i)$$ from my own distribution function? I know that there is a way to make own class for 1D variable. But what about 3D case?

• That depends on the distribution. Can you say anything about it? In the most general case, the MCMC methods are used for what you want. Oct 11 '21 at 18:19
• Yes, there are ways to accomplish this. In general, MCMC only samples from the target distribution approximately / asymptotically and produces correlated / dependent samples. But it really depends on the actual target. Rejection sampling is a simple method that may apply (depending on the distribution). Oct 13 '21 at 8:29