Python:Advanced Predictive Analytics
上QQ阅读APP看书,第一时间看更新

Random sampling and the central limit theorem

Let's try to understand these two important statistical concepts using an example. Suppose one wants to find the average age of one state of India, lets say Tamil Nadu. Now, the safest and brute-force way of doing this will be to gather age information from each citizen of Tamil Nadu and calculate the average for all these ages. But, going to each citizen and asking their age or asking them to tell their age by some method will take a lot of infrastructure and time. It is such a humongous task that census, which attempts to do just that, happens once a decade and what will happen if you decided to do so in a non-census year?

The statisticians face such issues all the time. The answer lies in random sampling. Random sampling means that you take a group of 1000 inpiduals (or 10000, depending on your capacity, obviously the more the merrier) and calculate the average for this group. You call this A1. Getting to this is easier as 1000 or 10000 is within your reach. Then you select a second group of 1000 or 10000 people and calculate their average. You call this A2. You do this 100 times or 1000 times and call them A3, A4,…, A100 or A3, A4,…, A1000.

Then according to the most fundamental theorem in statistics called the central limit theorem:

  • The average of A1, A2,…, A100 will be a good estimator of the average age of the residents of Tamil Nadu. If Am is the estimated average age of the residents of Tamil Nadu, then it is given by:
  • If the number of such samples is sufficiently large, then the distribution of these averages will roughly follow a normal distribution. In other words, A1, A2,…, A100 will be normally distributed.

Now, the thing is that we are no more interested in finding the exact value of the average age, but we are settling for an estimator of the same. In such a case, we will have to make do with defining a range of values in which the actual value might lie. Since we have assumed a normal distribution for the average age values of these groups, we can apply all the properties of a normal distribution to quantify the chances of this average age being greater or lesser than a certain number.