Skip to main content
Loading Explore guides…
Population & Samples · Acedra
Home
Explore
Statistics
Population & Samples
Sign in to save
Chat
If YouTube asks you to sign in, open the video on YouTube.
Watch on YouTube
Reload player
Transcript
75 segments
Copy
Hide video
0:13
the idea of a sample we need to understand that in any problem we are trying to solve in terms of statistics or probabilities we are really thinking about a large population whether this population is of uh measurements whether this population is of uh actual individuals and this is where our problem starts it starts with a population let's imagine that we have a full population of yellow balls in this example and every ball is numbered either from one to nine
0:47
so our population let's say we captured all this type of circles or balls in our
0:54
population and they are presented here and each of them has a value let's say it's it's the ball's age or it's the ball's weight whatever you want to think about but let's say we have all these yellow balls in the world captured over here and they have numbers from one to nine
1:14
now when we have this population we cannot really make our study on the full population because some the population could be billions if we're talking about human beings the population could be thousands if we're talking about some fish in a lake so we can only work with a sample so how is this sample created we're taking random selections from our population we're trying to make it as random as possible and building up a sample the sample will never
1:44
be as big as the population ideally it should but we can never reach to that but it should be randomly sampled to reach a situation where it is representative of the larger population so this is what we are trying to do we're trying to build a sample that is representative of the population and hence make some calculations on it to build some inference so in reality we can only work with
2:10
a sample we can never have the full population but the question comes as this little kid little smart kid is thinking what can we tell or what can we inference about the population from this sample so let's say we have a sample that is representing 10 percent of the population what can we tell about the population fully from this specific sample so can we for example know the mean of the
2:36
population so for example if we have the heights of children at the age of 10 all over the world can we take 100 or 1000 or 10 000 kids at the age of 10 and measure their heights and be able to tell what is the large population's mean of height what is the variance how do they differ from the mean and more importantly what are the probabilities of uh for example children being as high as such or as short as such given that popular given that sample and what is the mode
3:14
what is the value that we see repeating the most so things like this are the things we are trying to infer from a sample on the full population so this is the first part we need to really distinguish between a population which includes all observations or all individuals available and a sample which represents a percentage of that population that is supposedly randomly selected to a point where it is representative of the distribution of the population
3:48
we said distribution so what is a statistical distribution now let's say we have this jar of the sample bolts that we got from the population of probably i think they were 100 or something
4:02
and let's say we start checking what values are existing in our sample and we start stacking them so we will take one ball from this jar and put it on its location so we have one one we have two ones we have three ones until we get all the ones and stack them over each other we will do the same for the tools we will do the same for the threes same for the fours same for the fives and so on we will end up with a distribution or with a graph
4:33
that shows us how many ones do we have in our sample how many tools do we have in our sample so we can just count them so by having the frequency of the representation of every measurement in our sample we can build some type of a histogram or some type of a frequency count for the measurements that we got from our sample now if we go one further step and normalize this measurement so instead of saying 7 we want to say that we have a total of 33
5:10
balls in our sample and 7 over 33 of them are ones 6 out of 33 of them are twos 6 out of 3 of 6 out of 33 of them are threes and so on so by this we will have a percentage that we can expect the big population to have of once because remember we randomly selected the balls and we ended up with the majority being once so we can kind of tell that the majority of the population could be
5:43
once so this is what we have now is a probability because think about it now what is if i'm taking one from the taking a ball from the full population the probability of this ball being five for example as you see here is very low because when we took 33 balls from the large population only one of them was a five so the probability was is around one over thirty three
6:10
whereas if i take a ball it might very well be a one because one was the most represented in terms of proportions within our sample and so on so i can tell for example the probability of picking a 2 is around 6 over 33 the probability of picking a 2 or three is almost equal because when i sampled 33 from the large population i ended up with the same number of twos as threes and so on so this can give us something about the probability statement and this is a statistical
6:45
distribution so we basically distribute it over the numbers we got from our sample and we counted how many times did we get each number of course they these can be numbers these can be colors these can be a certain category of individuals but basically we are checking how many did we get in our sample from every category of interest and then normalizing by the dividing it by the total
7:13
and having percentages that state what proportion of each category is represented in our sample and this in a nutshell is probability in a frequentist paradigm so in probability we talk about frequentist or bayesian so in frequentist it's about the frequency it's about what are the chances of getting this number for example if i roll a dice the dice has 1 to 6 so if i roll it for example 10 000 times i expect to have the same number of ones as the same number of twos
7:47
or comparable number with all the numbers so it's a fair dice that has one over six probability for every number whereas a population of random balls that could have different measurements could have different proportions so probability really is telling me the proportion of seeing a certain measurement within my population let's think it about it a little more in an example so if we have a sample of adult males and we are interested in the adult male weight distributions
8:18
so if we think about it adult males probably around the world are something around 3 billion because they're supposedly 50 of the full human population so if we have a sample of those adult males let's say 10 let's say 20 let's say 100 we will just start stacking them over their actual weight and seeing what values we are seeing the most so we are seeing a condensation around 75 or 76 and we are seeing values that are going over the right and over the left
8:51
of that so basically this is how we start building a statistical distribution of our sample so just like the example before we stacked the values that are similar to each other above each other so we ended up with a distribution that is showing the sample we have uh uh let's say stacked over its measurements so we have for example one who is below 50 and one who is as uh heavy as 125 whereas
9:21
most of our sample is falling around 76 or 77 or somewhere in that range so this can tell us that the expected value of picking a random adult from our population or our world at large would be somewhere around 76 it's inferred from the mean of the sample that we had and we can also have a range or an idea of how wide our measurements could be by checking the variance so we can see for example in this sample that some went as low as around 48
9:58
and some went as high as 125. so we can tell about the center of the distribution we can tell about the the range or the width of the distribution and all these are type of interesting measurements in fact when we look about into the distribution we got more we see that it looks like a bell curve and this bell curve is the what we call or what you probably heard of as the normal distribution so there's a theory it's called the central limit theory we're not going to discuss it
10:27
here but basically the more samples you get the more probability that from a natural uh phenomena the more chances that they will look like a bell curve they will be centered around a certain mean and deviating from that mean towards the left or towards the right with a given variance so this is one of the uh very famous statistical distributions or common distribution which is called the normal distribution now why are they useful why didn't we just have
10:58
our sample and in there well statistical distributions are uh useful because they give us more confidence in any inference we make about the values that are outside of the sample so remember now if we wanted just to say for example how many adult males that i have that are of a weight of 76 kilograms i cannot just count the ones i have in my sample because really my sample is just a sample it's not of my interest my interest is to make an inference about the
11:29
bigger population so once i have a distributional form that is inferred from my sample i can apply this distributional form on the population at large and have more confidence in making any inference about the mean about the variance about the predictions i will be making in my population
11:50
so they enable us also calculating point estimates so for example when we saw this distribution we could have said that the actual mean as a point estimate is around 76 or 77 for the mean and the variance for example upon knowing the distribution parameters but when we talk about distributions or statistical distributions that we will see in the next episode we can tell a lot just by knowing the parameters so for example for the normal distribution
12:18
we only need to know the mean and the variance and we can infer everything else for the poisson distribution we need we can know just the rate tell so much about the expected value about the variance and about the mode and about so many different things so basically distributions make great statistical summaries of real life situations let's say you are interested in modeling the time you wait for a bus on a bus stop so if you are just taking some a couple of
12:49
samples one is seven minutes for example and one is 13 minutes you can say that the average is 30
12:57
plus 7 over 2 which is around 10 minutes but this is a very weak inference because we know that waiting for a bus in a bus stop is probably following an exponential distribution and once it's following an exponential distribution we can infer more about the mean than just taking the average of the sample so things like this uh make statistical distributions very useful and the common distributions that are used to model real life events much more
13:29
meaningful than just taking point estimates or statistical summaries that we are used to taking
13:36
now this leads us to something a little more deep into the topic which is the probability density and probability mass function now we talked about the balls example and we said that probably the probability in a frequentist paradigm is that i will select a 1 with a chance of 7 over 33 i will select a 2 with a chance of 6 over 33 and so on so basically the probability function tells us something about the probability of getting a certain measurement or a certain value
14:10
from our data at large let's look at this example this is a discrete random variable that is either one or two or three it cannot be 1.5 or 1.2 so basically took that sample of the discrete random variable that we have we stack them above each other and as we see here for example the we have low number of ones we have higher number of twos we have higher number of threes and so on while
14:35
most of our values are falling between the three and the four and going down from there so this is a discrete distribution of a random variable in the form of a probability mass function why is it called the mass function because the mass of the ones are stacked above each other in that place the mass of twos is stacked above each other in the second place so it's basically like a histogram so this is the probability mass function it works with discrete
15:07
data and if you remember we normalized it because we're interested in proportions so what is the proportion of ones so we divide by the full count so it was for example 7 over 33 in the first example so what none of those bars can be bigger than one because we divided by the total so it's gonna probably be in a range of ten percent twenty percent thirty percent the highest we can ever get is one hundred percent if all our data is of a certain measurement so the p of x the
15:40
small p of x here is the probability mass function and it ranges in the values between zero and one
15:47
if you think about it also it sums to one right because when you divide the whole thing by the total and you normalize it and then you have 7 over 33 then 6 over 33 then 6 over 33. if you sum all of these eventually they will be 33 over 33 and they will be one and the same thing in any probability mass function and that's in fact one of the properties of a proper probability mass function is that it should sum into one and the probability in a frequentist paradigm
16:19
of getting any value of x that is equal to small x so let's say what is the probability of getting small x over here equals 2 it will be the length of this bar because this bar is representing the proportion of the sample that is measure of two in our population so the probability of getting any specific value is just the value of the length of this bar so basically the small p of x tells
16:49
us the probability of getting a certain x value that is equal to the small x now if we talk about the continuous data it's a little bit different because with continuous data we don't have masses that are distributed remember we don't have actual values we have different measurements from different values that are probably infinite because the real numbers are infinite you can have 1.1 1.11 1.111 and each of these is different so really you have a way of looking at the density
17:22
where is our population more dense or where is our sample more dense in the measurements so we have a high density around this number we have low densities here but it is never zero for example for this curve so we always have a value that is of somehow of a proportion but it's uh not an a specific value it's a density of the sample we have so the probability density function is different from the probability mass function because it looks at continuous data or
17:57
continuous random variable it integrates to one it doesn't sum to one because you cannot really sum a continuous function but if you take the integral of it you will find that the area under this curve for any proper probability density function is one so it integrates to one but now think about a crazy fact what is the probability of getting a measurement that is 100.123
18:28
it's very very very low because if you think about it i can have any number in the real number line that is represented so looking at a specific number of a certain measurement can we can never actually draw this so if you have a big uh let's say uh it's difficult to talk about it in terms of the balls but let's say we have one million balls it's representing a different point at the 10 to the minus six so let's say we have point zero zero zero zero one point zero zero
19:01
zero zero two point zero zero zero three up to point nine nine three five one two three whatever having a specific value that i'm looking for is is almost impossible so if you think about it the probability of getting this number it's one over infinity because in a frequentist point of view it's the value i'm interested in over the full range of values so i'm interested in a single value out of infinite number of values so it's going to be 1 over infinity that is 0.
19:34
if i look at a different number also which is the probability of getting 100.534 it's also one value out of an infinite number of values so it's also zero if i want to take for a third example i want to pull this number out it's also going to be 1 over infinity which is 0. so this is an interesting fact about the probability density function that is different from the probability mass function so we cannot just say probability of x equals three for example is this number
20:08
so what can i do look at this confused man now he doesn't know what to do but what we this leads us to talking about a computer cumulative distribution function so cumulative distribution function allows us to make some inference about certain values existence within our population let's think about this if i cannot get the exact number because i can be talking about 3.645 or 3.643 which is a specific number what if i take a number a little bit above it and
20:43
a number a little bit below it and just talk about that specific uh slice of my distribution and say what is the density represented in that or what is the probability of getting a number between this specific range so instead of saying for example i want to get 3.54231 whatever i want to see what is the probability of drawing a number between 3.4 and 3.5 so here i'm just saying that's
21:14
my small x is my is between my small x minus a very small number which is this greek letter delta which is used to represent very very small numbers and plus a very small number that is almost a zero above and a zero below but it's really uh not zero so it's a little bit above and a little bit below so i'm talking about the slice i'm giving it a width instead of the width of
21:41
can this be a good approximate to probability of x equal x yeah it's an interesting idea so if i'm talking about the density of this slice can i represent the probability of this number by this slice and in fact it's a good approximation so really what is this it's basically the probability of x is smaller than x plus delta minus the probability of x is smaller than or equal x minus
22:11
delta think about it if i want to get the width of that slice in a continuous distribution i want to take anything that is below the larger value and subtract anything that is below the smaller value and i will be ending with the difference between these two values which is that slice that shows me that width of the data being in that specific location so draw it and convince yourself with it if you're talking basically about two points on a continuous scale and you're
22:45
taking the difference between those two points to understand what is the width of that region
22:52
so now we talked about the whole area from zero or even from the negative side if my data was distributed even on the negative scale until a specific x so what is this really this is my cumulative distribution function so basically it's the sum of all the distribution up until this point so let's look at look into it a little more so if this is my probability density function represented by small f of x and it looks like this if i want to talk about the probability
23:26
that x the large x is smaller than this specific small x the yellow i'm talking about this region because this region is somehow representing the probability of x being smaller than x so any point over here is of the larger than x any point over here is x is smaller than this the small x the same thing if i'm talking about this point if i'm talking about this point any point that has x value less than this yellow x is falling in this range whereas
24:01
any point that is having x bigger than the small x is falling in that range and the same thing for here now let's think about it a little more you see this now the red region is the full
24:16
area under that distribution curve and the yellow region is just my area of interest so as we said from a frequentist point of view we're interested in the proportion so we're really saying that the proportion of my data that is below a certain number which is the cdf is the division it's the ratio of this yellow region the small region over the red region because remember these curves are created by stacking all the values i have so here i have more values of that
24:49
specific number here i have less values of the specific value of x so if i'm interested in the chance of drawing a value that is in the yellow region its proportion is the yellow over the full right because i'm interested in getting a certain value that is represented with this proportion which is the yellow over the full region and this is the chance of drawing it now what is the red region if you remember from a couple of slides before we said we normalized so everything here
25:21
is integrating to one so really the region under the full curve which is the red region is one because it's normalized it's a proper probability distribution so really the probability of x is less than a certain small x is the yellow region and how do we calculate this if you remember from your calculus or your previous math classes the area under the curve is just the integral in our case it starts from zero and it ends at small x that is the yellow x and we're integrating
25:56
our f of x to get this specific region and this specific region is going to give us this probability of large x being smaller than this x now if we think about it what if we take all of what we said and instead of doing this every time integrating thinking about it a little more and we can just represent this integral in a function so if this function is representing the integral of this so basically i can just go into any point over here and get the probability of my
26:31
random variable value being less than this small x so this function let's go back one slide this function is the integral of this function so at any point it's giving me the integral of 0 to x of f x so for example if my x is here it's giving me the integral from 0 to this point of this function and this is basically my cumulative distribution function it's summing the distribution until it's end and in the end it will always reach one because if you remember that when i
27:06
integrate the full scale or the formula range of my data it will integrate to one because it's a normalized probability distribution so this function will always end at one and it will continue as one from there because the probability of getting a value that is less than the max value is always 100 percent so if i have data that is ranging until from 0 to 50. what is the probability of drawing a number less than 51 it's 100 percent because every
27:38
data point in my sample is less than 51. so this is my probability mass my cumulative distribution function and it's represented as capital p or capital f so basically p of x for a continuous distribution function is the representing the area under the curve for the probability density function so now what is it telling me as we just said it's telling me the probability of x smaller than or equal to this x and it's equal to p of x this function and why is this useful because if
28:14
you remember from a couple of slides ago we said we're interested in the size of that slice so what is the size of the slice going to be this time if the slice is between a value a and a value b let's say a is 3.5 and b is 3.6 and i'm interested in understanding what is the probability of my
28:35
random selection falling between 3.5 and 3.6 is just going to be the large p of 3.6 minus the large p of 3.5 because it's they're going to take the difference between that large region and this little smaller region and i'm going to end up with that shade of yellow in that specific range i'm interested in
29:02
so now we are we were able to conclude that basically the probability of x equals to small x is the probability of x being between a very small increment above and a very small increment below and given my data is normalized it's going to be just the width of that slice now what are the features of a cumulative distribution function well if you think about it we said it will always end at one and it will continue like this so if we take the probability of
29:34
another probability the cdf of infinity it's always going to be one because what is the probability of drawing a number that is uh smaller than infinity it's 100 percent every number that we know is smaller than infinity so it's going to be 100. if you think about the other side what is the probability of drawing a number that is smaller than negative infinity well negative infinity is the smallest number that we know of so it's going to be zero there's no way i'm going
30:03
to draw a number that is smaller than negative infinity it's strictly increasing because you're always adding probability even though our original probability density dropped but it was the area under the curve was still being added to the original area even though its rate is now slower so for example if you see from this graph it was the area was increasing in a very high rate and
30:28
then it started slowing down but still it's always strictly increasing it's always continuous to the right so if i take the value there's no sharp turns or no like two values for the same number because it says it's a representation of an integral of a smooth function so there's no sharp term so always the value that is just right to the value i'm interested in is equal so for example the limit of p of x plus a very small value that is almost zero is the same as p of
31:03
x so as you see here there's no sharp jumps in it by sharp jumps we're saying two values that are represented on the same line so every number of small x has one value for p of x
31:17
it contains all the probability information we need about x because remember anything that we want we want to understand what is the probability of x being smaller than a number we want to understand what is the probability of x being between a certain number and a certain number we want to know what is the probability of uh x being almost exactly that number with a small increment above or below all this information can be acquired from the cdf so we say it's comprehensive
31:47
of all the probability information that we need so very frequently you will start with your cdf and then decide if you need to differentiate it to get your pdf or you're satisfied with it now let's think about the last point of this video which is how to move between the community distribution function and the pm for pdf and vice versa so if we talk about the discrete random data so for discrete we said we have a probability mass function so to get the cdf we just
32:19
sum the probabilities until we reach one which means it's the full probability so for example if my proportion of data has 10 percent that are zeros i will just say that i have 10 percent from 0 to 1. so what is the cdf definition it's the probability of drawing a number that is less than 1. so what is the probability of drawing a number that is less than 1 it's 0.1 or it's basically the number of zeros i have in my sample over the total number which is 0.1
32:51
and now what is the probability that i draw a number that is less than two less than two strictly less nuts less or equal so less than two is basically either the ones or the zeros so basically it's a point three so as you see here it's a 0.3 the same thing for the for the probability of drawing a number that is less than 3 it's basically 0.1 plus 0.2 plus 0.4 until basically we reach 1 because when we sum all of these values it's 1. so what is the probability
33:25
of drawing a number that is less than 100 it's 1. what is the probability of drawing a number that is less than 5 it's 1 because all my numbers are either 0 1 2 3 or 4. so how did we move from this small p of x to the big p of x basically we summed so to move from the pmf to the cdf you sum the pmf and you get the representation of the cdf now for continuous it's a little different as we showed
33:55
so if my probability density function is like this my cdf is going to be the integration of this so first we will integrate from zero to for example uh one and we will get a function then we will integrate until we get to the point where the integral has one area that we reached it and if you remember we said it integrates to one so the integral will eventually reach one and continue from there so again what is the probability of getting a number that is less than five
34:26
it's one because all my numbers in my sample are less than five and so on i can see that there is a mode of two here or an expected value of two and it's represented with the highest frequency but of course it's not two exactly because this is continuous data so we can see that there is like a large increase until we reach 2 then the increase slows down until we plateau at 1. so basically to get the large f of x out of this small f x we integrate the pdf
35:00
and to get the small f of x from the big f of x we differentiate because this is just representing the slope of this function so we at the maximum point reach a slope of almost 0 which is this one then our slope goes down the other way and this in a nutshell is commutative distribution function probability density function and probability mass function they are the basis of understanding
35:26
any inference we make about probabilities in the next video we're going to talk about something that is very interesting we're going to talk about real life example so for example if our data represents count data how can we model it using common known distributions if our data represents uh waiting times how do we model it if our data represents a natural phenomenon what are the common distribution used for it and does we remember from that slide a
35:54
little while ago the distributions having a common distribution allows us to understand the phenomena and make inference that is much more powerful than just making inference about the numbers that we have in our sample with this we end the video thank you for watching if you like it please subscribe and like the video and wait for the next episode good luck with your data analysis
Here to help you learn
Sign in to keep a private conversation with your course tutor.
Ask me anything about the material…
Sign in to chat