Context Working with some biological datasets it was puzzling to see the patterns like Figure 2 (right) below. The first feeling was, that it corresponds to some biological effects like correlations between genes, however discussions with colleagues suggested that it more likely to be some purely mathematical phenomenon. Small simulation confirms that very simple mathematical model will reproduce the same effect which we see in biological data (single cell RNA sequencing data to be precise).
Setup Let us generate say $1000\times n$ random numbers from Poisson distribution and put them in a matrix of the size $(1000,n).$ Normalization: divide each ROW of the matrix by its sum. (So now rows will be summed to $1$). That is all – just plot the coordinates of the first two columns on a plane. We get figures like below (right sides – after normalization, left – before). Three plots for different $n=100,10,3$ with Poisson and one is for uniform distribution – which does NOT show similar phenomena.
Question Can one explain why for Poisson (and NOT the other tried distributions – uniform, normal, Pareto) seemingly non-random pattern arises? I mean it looks like points are aggregated into rays? What are the other distributions except Poisson will produce the same phenomenon?
Simulation code: https://www.kaggle.com/alexandervc/toy-model-for-single-cell-rna-seq-data More figures are there.
Essentially the code is:
X = np.random.poisson(5, size = (n_samples,n) )
v = X.sum(axis = 1) X2 = X / v[:,None] plt.scatter(X2[:,0],X2[:,1])