I recently encountered a strange situation while dealing with sampling :
Let's suppose I have X1 ... Xn random samples drawn from a population. Then I sort every samples and I make the sum of every samples. Why the sum sample seems to follow the same distribution as the original population and not a normal distribution ? Here is my python code if my question was not clear and an example with samples vs sorted samples :

n = 100
m= 100
k = 6

import numpy as np
import random 
import matplotlib.pyplot as plt

array2 = np.asarray([])
for j in range (200):
    array = np.asarray([0 for i in range(n)])  
    for i in range(m):
        sample = np.asarray([np.random.lognormal() for draw in range(n)])
        sample = np.sort(sample)
        array = np.add(array,sample)
    for element in array :
        array2 = np.append(array2, element)

plt.hist(array2, range(int(min(array2)), int(max(array2))))

non sorted


Many thanks in advance !!



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.