This lecture presents some examples of
Hypothesis testing, focusing on
**tests of hypothesis about the variance**, that is, on using a
sample to perform tests of hypothesis about the
variance of an unknown distribution.

Table of contents

In this example we make the same assumptions we made in the example of set estimation of the variance entitled Normal IID samples - Known mean. The reader is strongly advised to read that example before reading this one.

The sample is made of independent draws from a normal distribution having known mean and unknown variance . Specifically, we observe realizations , ..., of independent random variables , ..., , all having a normal distribution with known mean and unknown variance . The sample is the -dimensional vector , which is a realization of the random vector .

We test the null hypothesis that the variance is equal to a specific value :

We assume that the parameter space is the set of strictly positive real numbers, i.e., . Therefore, the alternative hypothesis is

To construct a test statistic, we use the following point estimator of the variance:

The test statistic
isThis
test statistic is often called **Chi-square statistic** (also
written as
**-statistic**)
and a test of hypothesis based on this statistic is called **Chi-square
test** (also written as
**-test**).

Let and . We reject the null hypothesis if or if . In other words, the critical region isThus, the critical values of the test are and .

The power function of the test iswhere is a Chi-square random variable with degrees of freedom and the notation is used to indicate the fact that the probability of rejecting the null hypothesis is computed under the hypothesis that the true variance is equal to .

Proof

The power function can be written aswhere we have definedAs demonstrated in the lecture entitled Point estimation of the variance, the estimator has a Gamma distribution with parameters and , given the assumptions on the sample we made above. Multiplying a Gamma random variable with parameters and by one obtains a Chi-square random variable with degrees of freedom. Therefore, the variable has a Chi-square distribution with degrees of freedom.

When evaluated at the point , the power function is equal to the probability of committing a Type I error, i.e., the probability of rejecting the null hypothesis when the null hypothesis is true. This probability is called the size of the test and it is equal to where is a Chi-square random variable with degrees of freedom (this is trivially obtained by substituting with in the formula for the power function found above).

This example is similar to the previous one. The only difference is that we now relax the assumption that the mean of the distribution is known.

In this example, the sample is made of independent draws from a normal distribution having unknown mean and unknown variance . Specifically, we observe realizations , ..., of independent random variables , ..., , all having a normal distribution with unknown mean and unknown variance . The sample is the -dimensional vector , which is a realization of the random vector .

We test the null hypothesis that the variance is equal to a specific value :

We assume that the parameter space is the set of strictly positive real numbers, i.e., . Therefore, the alternative hypothesis is

We construct a test statistic by using the sample meanand either the unadjusted sample varianceor the adjusted sample variance

The test statistic
isThis
test statistic is often called **Chi-square statistic** (also
written as
**-statistic**)
and a test of hypothesis based on this statistic is called **Chi-square
test** (also written as
**-test**).

Let and . We reject the null hypothesis if or if . In other words, the critical region isThus, the critical values of the test are and .

The power function of the test iswhere the notation is used to indicate the fact that the probability of rejecting the null hypothesis is computed under the hypothesis that the true variance is equal to and has a Chi-square distribution with degrees of freedom.

Proof

The power function can be written aswhere we have definedGiven the assumptions on the sample we made above, the unadjusted sample variance has a Gamma distribution with parameters and (see Point estimation of the variance), so that the random variablehas a Chi-square distribution with degrees of freedom.

The size of the test is equal to where has a Chi-square distribution with degrees of freedom (this is trivially obtained by substituting with in the formula for the power function found above).

Below you can find some exercises with explained solutions.

Denote by the distribution function of a Chi-square random variable with degrees of freedom. Suppose you observe independent realizations of a normal random variable. What is the probability, expressed in terms of , that you will commit a Type I error if you run a Chi-square test of the null hypothesis that the variance is equal to , based on the observed realizations, and choosing and as the critical values?

Solution

The probability of committing a Type I
error is equal to the size of the
test:where
has a Chi-square distribution with
degrees of freedom.
ButThus,If
you wish, you can utilize some statistical software to compute the values of
the distribution function. For example, with the MATLAB commands
`chi2cdf(65,39)`

and
`chi2cdf(15,39)`

we
obtainAs
a consequence, the size of the test
is

Make the same assumptions of the previous exercise and denote by the inverse of . Change the critical value in such a way that the size of the test becomes exactly equal to .

Solution

Replace
with
in the formula for the size of the
test:You
need to set
in such a way that
.
In other words, you need to
solvewhich
is equivalent
toProvided
the right-hand side of the equation is positive, this is solved
byIf
you wish, you can compute
numerically. From the previous exercise we know
thatTherefore,
we need to
computeIn
MATLAB, this is done with the command
`chi2inv(0.0444,39)`

, which gives as a
result

Make the same assumptions of Exercise 1 above. If the unadjusted sample variance is equal to 0.9, is the null hypothesis rejected?

Solution

In order to carry out the test, we need to compute the test statisticwhere is the sample size, is the value of the variance under the null hypothesis, and is the unadjusted sample variance.

Thus, the value of the test statistic isSince and , we have thatIn other words, the test statistic does not exceed the critical values of the test. As a consequence, the null hypothesis is not rejected.

The book

Most of the learning materials found on this website are now available in a traditional textbook format.

Featured pages

- Law of Large Numbers
- Convergence in probability
- Bernoulli distribution
- Beta distribution
- Bayes rule
- F distribution

Explore

Main sections

- Mathematical tools
- Fundamentals of probability
- Probability distributions
- Asymptotic theory
- Fundamentals of statistics
- Glossary

About

Glossary entries

- Factorial
- Mean squared error
- Type II error
- Probability mass function
- Continuous random variable
- Posterior probability

Share