Definition
Sampling distributions
Adapted
Defines a statistic and its sampling distribution, fixes the two rival conventions for the sample variance, and proves that for a normal sample the sample mean and the sample variance are independent with laws and , from which the Student and Fisher densities follow; worked on an eight-point sample giving and .
Prerequisites: The multivariate normal distribution, Expectation, variance and covariance, Joint distributions and transformations, The central limit theorem, Unitary and orthogonal matrices, Multiple integrals and change of variables, The Gamma function, The Beta function
Every number computed from data - a mean, a variance, a fitted slope - is a function of random variables and is therefore itself random. It has a distribution, and that distribution, not the number, is what licences any statement about the quantity being measured. The distribution of a statistic is called its sampling distribution, and the whole of estimation, interval construction and testing is bookkeeping on sampling distributions.
For one parent population - the normal - the sampling distributions of the two statistics a physicist computes first, the sample mean and the sample variance, are known exactly, for every sample size, in closed form. That is the content of this unit. Three named distributions appear: chi-squared for the sample variance, Student's for the mean divided by its own estimated error, and Fisher's for the ratio of two sample variances. Their appearance is not a coincidence of calculus; it comes from one geometric fact, that the standard normal law on is invariant under rotations.
A random sample of size from a distribution is a list of independent random variables each with distribution . Riley, Hobson and Bence call the population and write it when it is known up to a list of unknown parameters; independence then makes the joint density of the sample
A statistic is any function of the sample alone - it may not involve the unknown , because it has to be computable from the data. Being a function of random variables, is a random variable, and its distribution is the sampling distribution of . Riley, Hobson and Bence specify it by the transformation rule , where is the volume between the surfaces and ; this is the change-of-variables formula of Multiple integrals and change of variables written for one coordinate of the image. The sampling distribution depends on the parent , on the function and on , and in general on the true values as well - which is exactly why a statistic can carry information about .
For a sample the sample mean is
on which all our sources agree. For the spread there are two conventions in the library, and they differ by a factor :
This unit uses , with the divisor . Grimmett and Stirzaker leave the reasons for this choice to statistics texts, note that with it exactly, and record the rival convention in a footnote. Arfken, Weber and Harris reach the same divisor by a first-order argument: estimating the variance of by , the deviations satisfy (their sample standard deviation is our ). The that results, they say, allows for the probable error in , and they call it Bessel's correction. In the language of the proof below, one degree of freedom has been spent on estimating the mean. Note that is undefined at , as it should be: one reading says nothing about spread. Both multiply out to the same sum of squared deviations, so the conversion between them is
and every formula below can be rewritten in the other convention by that identity. Riley, Hobson and Bence also give the computing form , which needs one pass through the data instead of two.
Two facts hold for any parent population with finite mean and variance , normal or not, and are proved in Expectation, variance and covariance from linearity and the additivity of variances over independent summands:
Everything else below needs normality.
Let be positive integers.
Chi-squared. has the chi-squared distribution with degrees of freedom, written , if it is a gamma variate with parameters and , that is if it has density
with the gamma function of The Gamma function. Its mean is and its variance . Equivalently, and this is the form used throughout statistics, is the law of for independent standard normal : the gamma moment generating function is multiplicative in the shape parameter, so a sum of independent and variates is , and one standard normal square is : for , , whose derivative is , the density above with (Grimmett and Stirzaker, Example (4.7.1), p. 122). Riley, Hobson and Bence write the same object as for independent , and state that if the are subject to independent linear constraints then the order drops to . The theorem below is the leading instance of that rule.
Student's . If and are independent, then
has the distribution with degrees of freedom, written , with density
It is symmetric about ; is the Cauchy distribution, which has no mean, and for the mean is . As the density tends to , since .
Fisher's . If and are independent, then
has the distribution with and degrees of freedom, written , with density
Grimmett and Stirzaker note two consequences that are immediate from the definition: , by exchanging the roles of and ; and when , because . The mean of is when . Riley, Hobson and Bence write the normalising factor through the beta function of The Beta function; the two forms are the same.
Let be independent, each with the distribution, , and let and be the sample mean and the sample variance with divisor . Then:
- and are independent random variables;
- ;
- .
Consequently, writing
neither of which depends on once it is formed, the ratio
has the distribution. The unknown has cancelled: is computable from the data and alone, and its distribution involves no unknown parameter.
If, further, is a second sample, independent of the first, drawn from with the same variance, and is its sample variance, then independently of , so the variance ratio
again free of .
Only one idea is needed, and it is geometric. Write ; then the vector has density proportional to , which depends on only through its length. So the law of is unchanged by any rotation of , and the coordinates of in any orthonormal frame are again independent standard normals.
Now choose the frame to suit the question. Let the first axis be the diagonal direction . The first coordinate in that frame is , which carries the sample mean; the remaining coordinates are orthogonal to the diagonal, and because the length is preserved, the sum of their squares is , which is the sample variance up to a factor. So the mean lives on one axis and the variance on the orthogonal complement of that axis: independence of and is the independence of coordinates in a rotated frame, and the degrees of freedom are literally the dimension of the complement.
The and laws then cost nothing beyond a change of variables: is the law of a normal divided by the root of an independent chi-squared, the law of a ratio of two independent chi-squareds, and both densities come out of the standard two-variable transformation formula followed by one gamma integral.
Step 1: standardise. Put . Each is and they are independent, so the joint density of is
Also and
because the shift by cancels inside the bracket and the factor comes out squared. So the theorem is a statement about a standard normal vector.
Step 2: rotate. Let be any real orthogonal matrix and let be the coordinates of in the rotated frame, so that and, because preserves lengths (Unitary and orthogonal matrices), . The Jacobian of an orthogonal map has modulus , so by the change-of-variables formula the density of is : the same function. It factorises into standard normal densities, hence are independent variables. This is the only place normality is used, and it is used essentially: no other law on with independent identically distributed coordinates has a rotation-invariant density.
Step 3: choose the rotation. Take the first row of to be , a unit vector, and complete it to an orthonormal basis of (possible by Gram-Schmidt; the rows are then any orthonormal basis of the hyperplane ). With this choice
and by Step 2 - which says exactly that , that is . That is conclusion 2.
Step 4: identify the rest of the length. Subtracting the first square from the total,
the third equality being the identity , got by expanding the square and using .
Step 5: read off independence and the chi-squared law. By Step 2 the variable is independent of the block . By Step 3, is a function of alone; by Step 4, is a function of alone. Functions of independent variables are independent, so and are independent: conclusion 1. And by Step 4, is a sum of the squares of independent standard normal variables, hence by the additivity of chi-squared recorded in the definition: conclusion 3. The order is , not , because one linear constraint has been imposed - the residuals sum to zero and so lie in a hyperplane.
Step 6: the density. With and as in the statement and , and are independent by conclusion 1, so their joint density is the product
Change variables to with and , so and, at fixed , . The Jacobian is therefore and
Integrate out over . Substituting turns the integral into times , by the definition of the gamma function. The powers of do not quite cancel: , and this factor turns into , leaving
the density. Finally equals divided by , and the 's cancel, giving as claimed.
Step 7: the density. Let and be independent and set . The same two-variable device works: keep as the second coordinate, so with Jacobian , multiply the two gamma densities, and integrate out over . The -integral is again a gamma integral, of total order , and after collecting constants one obtains
Applying this with and , which are independent because the two samples are, gives the last claim of the statement.
Normality. Used once, in Step 2, and it is what the whole theorem rests on. Rotation invariance alone does not give independent coordinates (the uniform law on a disc is rotation-invariant, yet its two coordinates are dependent); the fact Step 2 rests on is narrower. A vector of independent standard normals has a rotation-invariant density, and among laws on with independent, identically distributed coordinates and a density, only a centred normal has one. For any other parent law, and are in general dependent. A two-point example makes this concrete: let and let each be with probability . Then and , and holds exactly when . Knowing one determines the other, so they are as far from independent as possible, although still holds.
Independence of the . Used in Step 1 to write the joint density as a product. Without it there is no rotation-invariant density to exploit. Correlated normal data can be brought back into the scheme by whitening - multiply by , with the covariance matrix, as in The multivariate normal distribution - but then the statistic being computed is not the ordinary .
Common variance for both samples, in the statement. If the two populations had variances , the ratio would be times an variable, so its distribution would involve the unknown ratio and could not be used without further assumption. This is precisely why the ratio is informative about that ratio.
. For there is no , and the complement of the diagonal axis in is ; the theorem degenerates correctly rather than failing.
What survives without normality. Only and , and - as a limit, not an identity - the approximate normality of for large given by the central limit theorem. The exact and laws are properties of the normal family alone, though they are mildly robust in practice.
A convention to watch. Riley, Hobson and Bence define the sample variance with divisor and accordingly write Student's statistic as , with under the root. Since , one has , so their and ours are the same number computed from the same data; the degrees of freedom are in both. Only the intermediate symbol differs. The same substitution turns their into our conclusion 3.
Given a sample believed to come from a normal population:
- Compute and the sum of squared deviations ; then and .
- If is known, use .
- If is unknown, use . This is the only change: the standard normal is replaced by with degrees of freedom, whose tails are heavier, the price of not knowing .
- For a statement about itself, use .
- To compare the spreads of two independent normal samples, of sizes and , use under the hypothesis of equal variances. Since , the ratio may be taken either way up, but the orientation must be fixed before the data are seen. For a one-sided question ("is sample 2 the noisier?") read the single tail on that side. For a two-sided question ("do the spreads differ?") the tail probability is twice the smaller of and at the observed value . Putting whichever sample variance happens to be larger on top and then reading one upper tail undoubled roughly halves this figure, because the orientation has been chosen from the data.
- Convert the resulting tail probability into an interval or a test with Confidence intervals or Hypothesis testing; this unit supplies the distributions, not the decisions.
A platinum resistance thermometer is held in a stirred water reference bath and read eight times. The readings, in degrees Celsius, are
Treat them as a random sample from .
Sample mean. The readings sum to , so with
Sample variance. The deviations from are , and they sum to zero, as they must. Their squares sum to
so
For comparison, the Riley-Hobson-Bence convention would give and , smaller by the factor .
Distance of the mean from a reference value. The bath is believed to sit at . Since is unknown we use the statistic of step 3:
to be read against . The two-sided tail probability is for , so a departure at least this large happens in about a third of samples of this size even when the bath is exactly at . Had been treated as known and equal to , the same ratio would have been read against , giving the smaller tail ; the difference is the penalty for estimating from seven degrees of freedom.
A statement about the spread. The manufacturer quotes a repeatability of . Under that value, step 4 gives
a draw from , whose mean is and standard deviation . The upper tail is : the observed scatter is entirely ordinary for the quoted repeatability.
A second sample and the variance ratio. The bath is re-read six times the next day, after the probe has been re-seated:
with and , hence . The question is two-sided - did the spread change between the days? - and we fix the orientation as day 2 over day 1:
a draw from if the two days share one . The upper tail is and the lower tail is , so by step 5 the two-sided tail probability is ; for a two-sided test at the level the ratio would have to exceed the point of , which is . The second day is noisier, but not by more than the ratio of two sample variances of these sizes routinely produces. The single tail would be the right figure only for the one-sided question "did re-seating make the probe noisier?", posed before the second day's readings were taken.
Every number above was computed to the digits shown; the three tail probabilities are , and .
Quoting an error bar. The statement " with degrees of freedom" is the normal-sample result above, and it is what a laboratory writes down after repeating a measurement. The is conclusion 2; the is conclusion 3; the fact that one may divide by the estimated and still know the exact distribution is conclusion 1 together with the law. For of order ten the difference between the and normal tails is tens of percent, which is why small-sample work quotes degrees of freedom and not just a standard error.
Qualifying an instrument. A detector specification of the form "resolution better than " is checked by reading against , exactly as in the example. The same chi-squared appears, with in place of , as the goodness-of-fit statistic of a least-squares fit with fitted parameters: each fitted parameter is one more linear constraint on the residual vector, one more dimension removed from the orthogonal complement, in exactly the sense of Step 4.
Comparing two populations. The ratio is the engine of the analysis of variance, in which a total sum of squares is split into orthogonal pieces - between groups and within groups - whose expectations differ if and only if the group means differ. The splitting is the same rotation argument applied to a coarser partition of , and the independence of the pieces, which is what makes the ratio an variable, is again the independence of coordinates in a rotated frame.
Spectral estimation. A periodogram ordinate formed from Gaussian noise is a sum of two squared normals, hence in distribution, which is why a raw periodogram has a relative error however long the record, and why averaging independent segments - adding degrees of freedom - is the only cure. The same counting gives the degrees of freedom of a smoothed spectral estimate.