This lecture presents some examples of Hypothesis testing, focusing on tests of hypothesis about the variance, i.e. on using a sample to perform tests of hypothesis about the variance of an unknown distribution.
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
is:
This
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
is:
Thus,
the critical values of the
test are
and
.
The power function of the
test
is:
where
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
.
The power function can be written
as:
where
we have
defined
As
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, using the sample mean
:
and
either the unadjusted sample
variance:
or
the adjusted sample
variance:
The test statistic
is:
This
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
is:
Thus,
the critical values of the
test are
and
.
The power function of the
test
is:
where
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.
The power function can be written
as:
where
we have
defined
Given
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
variable
has
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).