# How to validate if a sample is independent and identically distributed

How can I check if the data is drawn i.i.d. from an unknown multivariate distribution?

How can I check if the data is drawn i.i.d. from an unknown multivariate distribution?

You can't.

You can check for certain kinds of violation of independence, and for certain kinds of violation of identical distribution. However, failure to reject on such tests doesn't imply you do have independence or identical distribution.

For example, if you have observations over time you could check for the presence of serial correlation, a particular form of dependence. Or if you have some other variable on which you suspect the distributions might differ, you can check whether they are similar on that variable.

[Generally speaking, if you're trying to assess the suitability of the assumptions for some other procedure, formal testing of assumptions answers the wrong question and may be counterproductive.]

Independence is impossible to establish, so we go for less ambitious goals.

I would recommend you to look at randomness tests on NIST web site, if you have a large sample. They are specifically collected to test random number generators, which are supposed to output exactly i.i.d. random numbers.

If your samples are small, then maybe you could design your own little test suite. You'd want to test for serial autocorrelation, unit root and homoscedasticity at the very least. You could use the following tests for small samples:

UPDATE If you need to test two data sets whether they come from the same distribution, then K-S test (two sample) would be a place to start your thinking process.

• Thank you for your answer! But I think the tests you have proposed apply only to the part about independence and not so much to the part about identical distribution. How can I make sure that the samples I have drawn from the population are from the same distribution? How can I test if two datasets that are drawn by assumption from the same population have the same distribution? Dec 26 '14 at 21:20
• kolmogorov-smirnov test
– bsbk
Dec 26 '14 at 22:06
• @JimBoy, see the update Dec 26 '14 at 22:54