# Generating very few samples from a probability distribution using MCMC?

Since MCMC converges to target only after taking very large number of steps, what if I want to have just say 10 samples from target distribution? Do I still have to generate lots of samples, and then discard the rest?

Or like machine learning models, is there seperate training and testing part, where a model is trained to project an easy-to-sample distribution to our desired one?

• please let me know if this is duplicate. I tried searching around but don't really have the stat. vocabulary to do that properly – Shihab Shahriar Khan Dec 26 '18 at 7:18
• Can you increase the number of steps? – user2974951 Dec 26 '18 at 8:15
• sorry @user2974951, couldn't understand your question. Increase what steps? – Shihab Shahriar Khan Dec 26 '18 at 10:48
• MCMC is used to sample from an unknown distribution, the more observations you can get the better as it better approximates it. Why do you want to select only 10 observations? Are you trying to randomly sample 10 observations from this distribution? If so, then you would pick 10 observations at random from all the available ones, however keep in mind that the observations are likely correlated. – user2974951 Dec 26 '18 at 11:07
• Yes, usually MCMC has a "warm-up" period during which you do not sample. This step is used to make sure that there are no problems at the beginning with convergence. If, however, you had strong knowledge / you knew that your MCMC would start at the right point of the distribution then you would have no need for a warm-up period. if so, you could ignore the warm-up and go straight to sampling. – user2974951 Dec 26 '18 at 12:29

2. Monte Carlo: To answer your question, I would need to know more about what you're using your samples for. But generally, if you're doing MCMC, samples are used for Monte Carlo averages. That is, if your target distribution is $$\pi$$, and you're using MCMC to estimate $$E_{\pi}g = \int g(x) \pi(dx)$$, then from a Markov chain sample $$X_1, \dots, X_n \sim \pi$$, the Monte Carlo estimator of $$E_{\pi}g$$ is $$\dfrac{1}{n} \sum_{t=1}^{n} g(X_t)\,.$$ That is a true average is estimated by a sample average. Now the question is, if you're given a distribution, and given samples from that distribution, then are 10 samples enough to estimate the mean of the distribution relatively well? The answer is almost unequivocally, no. 10 samples from the target distribution is nearly not enough, let alone the fact that MCMC gives you "corrupt" samples, since they are correlated. To understand how many samples after "burn-in" you may need, read this post and my answer there.