# What does “sampling period” mean in MCMC?

In MCMC,

Use a single chain with a burn-in period of 100 iterations and a sampling period of 1000 iterations.

If I am correct, the "burn-in period" is the length of the first part of a sample path that is to be discarded.

What does the "sampling period" mean?

Suppose from a MC, $(X_1, X_2, \dots, X_N)$ is a single sample path of the chain (where the sample path length $N$ is sufficiently large), and the burn in period is $t_b$, and the sampling period is $t_s$.

Is it correct to collect $X_{t_b}, X_{2*t_b}, \dots, X_{t_s*t_b}$ as iid sample of the stationary distribution?

Does the sample period $t_s$ mean the sample size for the sample that I need to collect?

Thanks!

The burn in period is the number of samples you wait before you regard the sampler as having converged - for the Markov chain mixing time to elapse. If it has converged so that you are sampling from the stationary distribution, then your samples should be from the desired joint distribution.

So then the sampling period refers to the number of iterates for which you then collect data from the sampler.

However you should note that terminology is not always universal -- some people may use somewhat different names for some of these things.

It's generally not necessary to 'skip' observations; in many cases it's much more efficient to keep the correlated samples and deal with the correlation. Nevertheless many people do skip ... but the size of the skips is not the sampling period. It's also not the same as the burn-in.

The skips are used to space observations so that the dependence between successive samples has time to die down - very much in the way autocorrelation dies down for an AR. This is quite different from the mixing time for the Markov chain. We don't need to wait for it to remix, just for the dependence in successive iterates to die out.

The purpose is quite different and the time required is usually different (generally smaller).

So you might - for example - burn in for 100, sample for 10000, and then take say every tenth observation, getting 1000 nearly-independent values. Or you might instead keep the whole sampling period for a shorter run, but then you must deal with the dependence in the draws from the stationary distribution. For example, variances of means will need to deal with the autocorrelation structure in the draws.

Your suggested scheme of making the skip interval the same as the burn in would only work if the burn in was longer than the necessary skip time. Since burn-in would usually be much longer than the necessary skip time, it would work but be incredibly wasteful of iterates. (If you're going to do that you might as well restart the sampler each time you sample one value.)

• Thanks! (1) Is the sampling period same as the sample size? (2) So between every two sample points that I will collect, the number of iterations I have to wait/discard is the burn-in period? – Tim Feb 28 '14 at 13:40
• (1) It depends on what you mean by sample size. (2) No, once it's converged, you're sampling from the stationary distribution. See my edit. – Glen_b Feb 28 '14 at 13:43
• (1) for example, I would like to collect a iid sample $\{ x_1,\dots, x_n\}$ of the stationary distribution, which indicates the sample size is $n$. Is the sampling period same as the sample size? (2) if I want iid sample, shouldn't I wait a burn-in period between every two sample points $x_i$ and $x_{i+1}$, $i =1,\dots, n-1$? – Tim Feb 28 '14 at 13:49
• (1) Then no, since successive iterates are dependent. The sample size would be the sampling period divided by the skip length necessary to get approximate independence; (2) I already answered this question; it's still no. The Markov chain mixing time is NOT the same thing as the time for the dependence to die out when you're sampling from the stationary distribution. – Glen_b Feb 28 '14 at 13:51
• What I learned about mixing is that after a period of mixing time, the chain value will become independent of the chain value right before the period of mixing time. If my goal is to get iid sample, shouldn't I wait a period of mixing time for the next sample point, after I get the last sample point? – Tim Feb 28 '14 at 14:02

The sampling period is usually the number of samples you take from each "run" of a chain before it is restarted.

If you have a burn-in period of $n_b=100$ and a sample period of $n_s=1000$ your sample for the first run will be the $1000$ values following the burn in period. $$\mathbf{X}_1 = \{x_{101}, \ldots, x_{1100}\}$$

You then restart your chain and discard the first $n_b$ samples and keep the following $n_s$ values, $$\mathbf{X}_2 = \{x_{101}, \ldots, x_{1100}\}$$ etc. until you reach your desired sample size.

Your total sample (of size $n$) is then the union of all the values received from each run, $$\mathbf{X} = \bigcup_{i=1}^n\mathbf{X_i}.$$

• Thanks! If I would like to collect iid sample, those points in $X_1$ are not independent from each other. So here is how I understand: Suppose from a MC, I get $X_1, X_2, \dots, X_N$ from each iteration of a single sample path of the chain (where the sample path length $N$ is sufficiently large), and the burn in period is $t_b$, and the sampling period is $t_s$. Is it correct to collect $X_{t_b}, X_{2*t_b}, \dots, X_{t_s*t_b}$ as iid sample of the stationary distribution? So does the sample period $t_s$ mean the sample size for the sample that I need to collect? – Tim Feb 28 '14 at 14:08
• Well, that is not really the question and will greatly depend on the target distribution and sampler you use. An independent Metropolis-Hastings sampler will give independent samples after it reaches stationarity. If you want to discard samples to make it less dependent this is of course fine. You just need to sample more. – while Mar 1 '14 at 7:12