]>
Suppose that we have a basic random experiment and that is a real-valued random variable for the basic experiment. Now suppose we perform independent replications of the basic experiment. This defines a new, compound experiment with a sequence of independent random variables , each with the same distribution as . Recall that in statistical terms, is a random sample of size from the distribution of . The sample mean is simply the average of the variables in the sample:
The sample mean is a function of the random sample and thus is a statistic. Like any statistic, the sample mean is itself a random variable with a distribution, mean, and variance of its own. Many times, the distribution mean is unknown and the sample mean is used as an estimator of this unknown parameter. When the underlying sample is understood, we will usually suppress it from the notation.
In the dice experiment, the dice scores form a random sample from the specified die distribution. Select the average random variable; this variable is the sample mean for the sample of dice scores. For each die distribution, start with 1 die and increase the sample size . Note the shape and location of the probability density function of the sample mean at each stage. For selected values of , run the simulation 1000 times with an update frequency of 10. Note the apparent convergence of the empirical density function to the true density function.
Use basic properties of expected value to show that .
Exercise 2 shows that the sample mean is an unbiased estimator of the distribution mean . Therefore, the variance of is the mean square error, when is used as an estimator of .
Use basic properties of variance to show that .
From Exercise 3, the variance of the sample mean is an increasing function of the distribution variance and a decreasing function of the sample size. Both of these make intuitive sense if we think of the sample mean as an estimator of the distribution mean.
In the dice experiment, select the average random variable, which as noted before, is the sample mean for the sample of dice scores. For each die distribution, start with 1 die and increase the sample size . Note that the mean of the sample mean stays the same, but the standard deviation of the sample mean decreases (as we now know, in inverse proportion to the square root of the sample size). For selected values of , run the simulation 1000 times, updating every 10 runs. Note the apparent convergence of the empirical moments of the sample mean to the true moments.
Compute the sample mean of the petal width variable for the following cases in Fisher's iris data. Compare the results.
Computing the sample mean is a linear operation.
Suppose that and are random samples of size (defined on the same probability space), and that is a constant. Show that
The law of large numbers states that the sample mean converges to the distribution mean as the sample size increases, and is one of the fundamental theorems of probability. There are different versions of the law, depending on the mode of convergence.
Suppose again that is a real-valued random variable for our basic experiment, with mean and standard deviation (assumed finite). We repeat the basic experiment indefinitely to create a new, compound experiment with an infinite sequence of independent random variables , each with the same distribution as . In statistical terms, we are sampling from the distribution of . For each , let denote the sample mean of the first sample variables:
From Exercise 3, note that as . This means that as in mean square.
Use Chebyshev's inequality to show that for any .
.This means that as in probability. Recall that in general, convergence in mean square implies convergence in probability. The convergence of the sample mean to the distribution mean in mean square and in probability are known as weak laws of large numbers.
The strong law of large numbers states that the sample mean converges to the distribution mean with probability 1 . As the name suggests, this is a much stronger result than the weak law. That is, the strong law of large numbers states that
The following exercises sketch the proof of the strong law of large numbers. First, let so that .
Use Chebyshev's inequality to show that for every and every ,
Use the result of the previous exercise and the first Borel-Cantelli lemma to show that for every ,
Use the result of the previous exercise and Boole's inequality to show that
Conclude from the previous exercise that
Suppose temporarily that the underlying sampling variable is nonnegative:
Show that with probability 1, is increasing in .
For , let be the unique positive integer such that .
Use the result of the previous exercise and algebra to show that, with probability 1,
Use Exercise 11 and Exercise 13 and the squeeze theorem
for limits to conclude the strong law of large numbers for a nonnegative variable:
We now relax the condition that the underlying sampling variable be nonnegative, and we recall the definitions of the positive and negative parts a real number :
Recall also that , , , and .
Use Exercise 6 and Exercise 14 to show that with probability 1,
Finally conclude that with probability 1.
The proof of the strong law of large numbers sketched above requires that the variance of the sampling distribution be finite (note that this is critical in Exercise 8 and Exercise 9). However, there are better proofs that only require that . See, for example, Probability and Measure by Patrick Billingsley
In the dice experiment, recall again that the dice scores form a random sample from the specified die distribution. Select the average random variable, which is the sample mean of the sample of dice scores. For each die distribution, start with 1 die and increase the sample size . Note how the distribution of the sample mean begins to resemble a point mass distribution. Run the simulation 1000 times, updating every 10 runs. Note the apparent convergence of the empirical density of the sample mean to the true density.
Many of the applets in this project are simulations of experiments with a basic random variable of interest. When you run the simulation, you are performing independent replications of the experiment. In most cases, the applet displays the mean of the distribution numerically in a table and graphically as the center of the blue horizontal bar in the graph box. When you run the simulation, sample mean is also displayed numerically in the table and graphically as the center of the red horizontal bar in the graph box.
In the simulation of the binomial coin experiment, select the number of heads. For selected values of the parameters, run the simulation 1000 times updating every 10 runs and note the apparent convergence of the sample mean to the distribution mean.
In the simulation of the matching experiment, the random variable is the number of matches. For selected values of the parameter, run the simulation 1000 times updating every 10 runs and note the apparent convergence of the sample mean to the distribution mean.
In the simulation of the gamma experiment, the random variable represents a random arrival time. For selected values of the parameters, run the experiment 1000 times with an update frequency of 10. Note the apparent convergence of the sample mean to the distribution mean.
Random samples and their sample means are ubiquitous in probability and statistics. In this subsection, we will see how sample means can be used to estimate probabilities, density functions, and distribution functions.
Suppose that is a random variable for a basic experiment, taking values in a space . Note that might be the outcome variable for the entire experiment, in which case would be the sample space. In any event, is a general space so may be vector-valued. Recall that the distribution of is the probability measure on given by
Now suppose that we repeat the basic experiment indefinitely to form a random sample of size from the distribution of . The empirical distribution of for this sample is defined by
Although we are suppressing the dependence on the sample in our notation, note that for each , is a statistic that gives the proportion of sample values in .
Show that for fixed , is the sample mean from a random sample of size from the distribution of the indicator random variable . Thus, conclude that
This special case of the law of large numbers is central to the very concept of probability.
Show that for a fixed sample, satisfies the axioms of a probability measure.
The empirical distribution of , based on the random sample, is a random, discrete distribution, concentrated at the distinct sample values . Indeed, it places probability mass at for each , so that if the sample values are distinct, the empirical distribution is uniform on these sample values.
Several applets in this project are simulations of random experiments with events of interest. When you run the experiment, you are performing independent replications of the experiment. In most cases, the applet displays the relative frequency of the event and its complement, both graphically in blue, and numerically in a table. When you run the experiment, the relative frequencies are shown graphically in red and also numerically.
In the simulation of Buffon's coin experiment, the event of interest is that the coin crosses a crack. Run the experiment 1000 times with an update frequency of 10. Note the apparent convergence of the relative frequency of the event to the true probability.
In the simulation of Bertrand's experiment, the event of interest is that a random chord
on a circle will be longer than the length of a side of the inscribed equilateral triangle. Run the experiment 1000 times with an update frequency of 10. Note the apparent convergence of the relative frequency of the event to the true probability.
Suppose now that is a real-valued random variable for a basic experiment. Recall that the distribution function of is the function given by
Now suppose that we repeat the basic experiment times to form a random sample of size from the distribution of . It is natural to define the empirical distribution function for this sample by
Although we are suppressing the dependence on the sample in our notation, note that for each , is a statistic that gives the proportion of the sample variables that are less than or equal to .
Show that is the distribution function of the empirical distribution of , based on the random sample . In particular,
Show that for each , is the sample mean from a random sample of size from the distribution of the indicator variable . Thus, conclude that
Suppose now that is a random variable for a basic experiment with a discrete distribution on a countable set . Note that no assumptions are imposed on , other than countability, so that in particular, may be vector-valued. Recall that the probability density function of is the function given by
Now suppose that we repeat the basic experiment times to form a random sample of size from the distribution of . It is natural to define the relative frequency function or empirical density function of for this sample as follows:
Although we are suppressing the dependence on the sample in our notation, note that for each , is a statistic that gives the proportion of the sample variables that have the value .
Show that is the probability density function of the empirical distribution of , based on the sample . In particular,
Show that for each , , is the sample mean from a random sample of size from the distribution of the indicator variable . Thus, conclude that
Show that if is real-valued, then the sample mean of the random sample is the mean computed relative to the empirical density function. That is,
Many of the applets in this project are simulations of experiments which result in discrete variables. When you run the simulation, you are performing independent replications of the experiment. In most cases, the applet displays the true density function numerically in a table and visually as a blue bar graph. When you run the simulation, the relative frequency function is also shown numerically in the table and visually as a red bar graph.
In the poker experiment, the random variable is the type of hand. Run the simulation 1000 times updating every 10 runs and note the apparent convergence of the empirical density function to the true density function.
In the simulation of the binomial coin experiment, the random variable is the number of heads. Run the simulation 1000 times updating every 10 runs and note the apparent convergence of the empirical density function to the true density function.
In the simulation of the matching experiment, the random variable is the number of matches. Run the simulation 1000 times updating every 10 runs and note the apparent convergence of the empirical density function to the true density function.
Recall again that the standard -dimensional measure on is given by
In particular is the length measure on , is the area measure on , and is the volume measure on .
Suppose now that is a random variable for a basic experiment, with a continuous distribution on , and that has probability density function . Technically, is the probability density function with respect to . Thus, by definition,
Again we repeat the basic experiment times to form a random sample of size from the distribution of . Suppose now that is a partition of into a countable number of subsets. As before, we can define the empirical probability of , based on the sample, by
We then define the empirical density function as follows:
Clearly the empirical density function depends on the partition, as well as the sample, but we suppress this to keep the notation from becoming completely unwieldy. Of course, for each , is a random variable (in fact, a statistic), but by the very definition of density, if the partition is sufficiently fine (so that is small for each ), and if the sample size is sufficiently large, then by the law of large numbers,
Show that the empirical density function satisfies the mathematical properties of a probability density function for a continuous distribution on :
In fact, show that the empirical density function corresponds to the distribution for which is uniformly distributed over for each
Many of the applets in this project are simulations of experiments which result in variables with continuous distributions. When you run the simulation, you are performing independent replications of the experiment. In most cases, the applet displays the true density visually as a blue graph. When you run the simulation, an empirical density function is also shown visually as a red bar graph.
In the simulation of the gamma experiment, vary the parameters and note the shape and location of the probability density function. For selected values of the parameters, run the experiment 1000 times with an update frequency of 10. Note the apparent convergence of the empirical density function to the true density function.
In the simulation of the random variable experiment, select the normal distribution. Run the experiment 1000 times with an update frequency of 10, and note the apartment convergence of the empirical density function to the true density function.
Many of the concepts discussed above are frequently used in exploratory data analysis. Specifically, suppose that is a variable for a population (generally vector valued), and that are the observed data from a sample of size , corresponding to this variable. For example, might be encode the color counts and net weight for a bag of M&Ms. Now let be a partition of the data set, where is a finite index set. The sets in the partition are generally known as classes. Just as above, we define the frequency of by
We define the relative frequency of by
Finally, if is a continuous variable, taking values in , we define the density of by
The mapping that assigns frequencies to classes is known as a frequency distribution for the data set. The mapping that assigns relative frequencies to classes is known as a relative frequency distribution for the data set. Finally, in the case of a continuous variable, the mapping that assigns densities to classes is known as a density distribution for the data set. When or , the bar graph of any of these distributions is known as a histogram.
The whole purpose of constructing and graphing one of these empirical distributions is to summarize and display the data in a meaningful way. Thus, there are some general guidelines in choosing the classes:
In the interactive histogram, click on the -axis at various points to generate a data set with 20 values. Vary the class width over the five values from 0.1 to 5.0 and then back again. For each choice of class width, switch between the frequency histogram and the relative frequency histogram. Note how the shape of the histogram changes as you perform these operations.
It is important to realize that frequency data is inevitable for a continuous variable. For example, suppose that our variable represents the weight of a bag of M&Ms (in grams) and that our measuring device (a scale) is accurate to 0.01 grams. If we measure the weight of a bag as 50.32, then we are really saying that the weight is in the interval (or perhaps some other interval, depending on how the measuring device works). Similarly, when two bags have the same measured weight, the apparent equality of the weights is really just an artifact of the imprecision of the measuring device; actually the two bags almost certainly do not have the exact same weight. Thus, two bags with the same measured weight really give us a frequency count of 2 for a certain interval.
Again, there is a tradeoff between the number of classes and the size of the classes; these determine the resolution of the empirical distribution. At one extreme, when the class size is smaller than the accuracy of the recorded data, each class contains a single datum or no datum. In this case, there is no loss of information and we can recover the original data set from the frequency distribution (except for the order in which the data values were obtained). On the other hand, it can be hard to discern the shape of the data when we have many classes with small frequency. At the other extreme is a frequency distribution with one class that contains all of the possible values of the data set. In this case, all information is lost, except the number of the values in the data set. Between these two extreme cases, an empirical distribution gives us partial information, but not complete information. These intermediate cases can organize the data in a useful way.
In the interactive histogram, set the class width to 0.1. click on the -axis to generate a data set with 10 distinct values and 20 values total.
In Michelson's data, construct a frequency distribution for the velocity of light variable. Use 10 classes of equal width. Draw the histogram and describe the shape of the distribution.
In Cavendish's data, construct a relative frequency distribution for the density of the earth variable . Use 5 classes of equal width. Draw the histogram and describe the shape of the distribution.
In the M&M data, construct a frequency distribution and histogram for the total count variable and for the net weight variable.
In the Cicada data, construct a density distribution and histogram for the body weight variable for the cases given below . Note any differences.
In the interactive histogram, set the class width in the to 0.1 and click on the axis to generate a distribution of the given type with 30 points. Now increase the class width to each of the other four values and describe the type of distribution.