Section 10.6 Interval Estimates - Confidence Interval for
Once again, you may need to approximate the population variance or standard deviation but only have the sample values available. One difference from the previous sections is that you are not dealing with an average of values (such as or ) but with the average of the squares of values. The Central Limit Theorem does not directly help you in this case but the following result (presented without proof) provides a solution.
Theorem 10.6.1. Relationship between Variance and
To create a confidence interval for first consider an interval of the form
and determine values for the boundaries so that the likelihood of this being true is high. For this case, since the chi-square distribution only has a positive domain and is not symmetrical, you will not expect to determine a symmetrical confidence interval. Therefore, consider
and by playing around with algebra you get
or by inverting the inequality yields
Using the previous theorem, note that the inside variable can be replaced with a chi-square variable. If F is the distribution function for chi-square, then you get
For a given value of there are many possible choices but often one often utilized is one in which
and
Using the inverse chi-square gives values for the expression on the inside and algebra can be used to solve for each of Indeed,
and
To determine appropriate values for and with equal probabilities in each tail, consider using the interactive cell below:
xxxxxxxxxx
print("Confidence Interval for variance using equally-sized tails")
# Chi-Square Calculator for confidence intervals with equal alpha/2 tails
var('t')
layout=dict(top=[['c'],['n']])) (
def _(c=input_box(0.95,width=10,label='Confidence Level = '),n=input_box(20,width=8,label='n =')):
alpha = 1-c
T = RealDistribution('chisquared', n)
a = T.cum_distribution_function_inv(alpha/2)
a1 = T.cum_distribution_function(a)
b = T.cum_distribution_function_inv(1-alpha/2)
b1 = T.cum_distribution_function(b)
print('From the Chi-Square distribution for X:')
print('P(',a,'< X < ',(b),') = ',c)
print('with')
print('P( X < ',a,') = ',a1)
print('P( X < ',b,') = ',b1)
f = x^(n/2-1)*e^(-x/2)/(gamma(n/2)*2^(n/2))
M = f(x=n).n() # to scale by the maximum of f
G = plot(f,x,0,b+(b-a)/2)+plot(f,x,a,b,thickness=5,color='green',fill=True,fillcolor='yellow')
G += line([(a,0),(a,f(x=a))],color='green',thickness=5)
G += line([(b,0),(b,f(x=b))],color='green',thickness=5)
G += text(str(c.n(digits=5)),((a+b)/2,f(x=(a+b)/2)/3),color='green')
G += text(str((alpha/2).n(digits=5)),(a/2,0.01),color='red',fontsize=5)
G += text(str((alpha/2).n(digits=5)),(b+a/2,0.01),color='red',fontsize=5)
G += text("$\\chi^2_{\\alpha/2} $",(a,-M/5),color='red',fontsize=10)
G += text("$\\chi^2_{1-\\alpha/2} $",(b,-M/5),color='red',fontsize=10)
G.show(figsize=(5,3))
Example 10.6.2. - Two-sided Confidence interval for and .
Given the data 570, 561, 546, 540, 609, 580, 550, 577, 585, determine a 95% confidence interval for
Using the computational forumaula (or your calculator) gives Also, notice for n=9, the resulting interval will use a Chi-square variable with 8 degrees of freedom. Using the symmetric option, gives and Therefore
and
Hence, you are 95% certain that
By taking square roots you get
Notice, this interval is relatively wide which is a result both of the number of data values being relatively small (n=9) and the actual data values being relatively large and spread out.
Checkpoint 10.6.3. WebWork - Two-sided Confidence Interval with large n.
Suppose that you have n=400 data values and suppose you have computed from those a sample variance of Then, the only change in the calculation is the two chi-square statistic values. For 95% but now with 399 degrees of freedom and
Therefore
and
Hence, you are 95% certain that
By taking square roots you get
which is a relatively tight confidence interval. Notice, these are also completely contained in the confidence intervals from the previous small n example.
Similar to above, another choice to estimate is to use a one sided confidence interval. If you want to find one of these, continue as described above but just leave one endpoint off. Indeed,
can be determined using
and
can be determined using
Example 10.6.4. - One-sided Confidence intervals for .
TBA
You can, of course, use the formula to work out the sample size needed in order to have a sufficiently narrow confidence interval
Checkpoint 10.6.5. WebWork - One-sided Confidence Interval.
Find the minimum sample size needed to be % confident that the sample variance is within % of the population variance.
Finally, to determine a confidence interval for proceed using the protocols described above and simply take the square root on the resulting interval.
Example 10.6.6. - Confidence intervals for .
TBA