# Selecting null reference distribution

I was going through an explanation of gap statistic here when I happened to come across the phrase null reference distribution of the data. And this is something I need help to understand.

From what I understand from reading online that to conduct a hypothesis testing, you'll need data points to compare against the actual data and these points are provided by a particular distribution of data. Using these two a statistical test will be conducted which will provide us with some information about the actual data we have.

Am I understanding this correctly? If so, then how do we select this null reference distribution of data? The actual distribution could be anything. It could be a combination of multiple altogether different distributions. How do we select one then?

Specifically speaking, in this case, while explaining the GAP statistic, the documentation says

Generate B reference data sets with a random uniform distribution

How did they come to conclude that they should use a random uniform distribution? Why not Gaussian or some other distribution?

And also, why do I need B copies. Is it a sense cross validation-esque?

In the standard Gap statistics method, we standardize the graph of log($$W_k$$), where $$W_k$$ is within cluster dispersion, by comparing it to the expectation of $$W_k$$ under appropriate null reference distribution of the data. In statistics, not every algorithm is suitable for all the cases. Every algorithm has its drawback. It is not mandatory to use random uniform distribution of data in all the cases. In particular, the choice of choosing a random uniform distribution over Normal distribution solely depends upon the compactness of cluster your model has generated. It has been studied by Yin et al. (2008) that in situation where clusters contain data points of different densities, standard Gap method might fail and he suggested to use reference data sets sampled from Normal distribution rather than Uniform distribution. For more information, you can refer this link.