% This is a simple LaTex sample document that gives a submission format
%   for IEEE PAMI-TC conference submissions.  Use at your own risk.

% Make two column format for LaTex 2e.
\documentclass[11pt,twocolumn]{article} %,twocolumn

\documentclass[11pt,twocolumn]{article} %,twocolumn
\usepackage[dvips]{graphicx,graphics,color}
\usepackage{times,amsmath,amsfonts}


% Add the period after section numbers.  Adjust spacing.
\newcommand{\Section}[1]{\vspace{-8pt}\section{\hskip -1em.~~#1}\vspace{-3pt}}
\newcommand{\SubSection}[1]{\vspace{-3pt}\subsection{\hskip -1em.~~#1}
        \vspace{-3pt}}
\newcommand{\bqn}{\begin{eqnarray}}
\newcommand{\eqn}{\end{eqnarray}}
\newcommand {\diff}[1] {\frac{\partial}{\partial #1}}
\newcommand{\jacob}[3]{\frac{\partial^2 #3}{\partial #1 \partial #2}}
\newcommand{\der}[2]{\frac{\partial #2}{\partial #1}}


\setlength{\textheight}{10in} \setlength{\textwidth}{6.875in}
\setlength{\columnsep}{0.3125in} \setlength{\topmargin}{-0.5in}
\setlength{\headheight}{0in} \setlength{\headsep}{0in}
\setlength{\parindent}{1pc}
\setlength{\oddsidemargin}{-.2in}  % Centers text.
\setlength{\evensidemargin}{-.2in}

\begin{document}

% Don't want date printed
%\date{January 23, 2003}

% Make title bold and 14 pt font (Latex default is non-bold, 16pt)
\title{Stat 312: Lecture 10\\
Confidence intervals for variance}

% For single author (just remove % characters)
\author{Moo K. Chung\\
mchung@stat.wisc.edu}
% For two authors (default example)
\maketitle
\thispagestyle{empty}

\begin{enumerate}
\item Suppose the fat content of a hotdog follows normal
distribution. 10 measurements are given.
\begin{verbatim}
> x<-c(25.2,21.3,22.8,17.0,29.8,21.0,
       25.5,16.0,20.9,19.5)
\end{verbatim}
We are interested in constructing interval estimate of the unknown
population variance. To solve this problem, we need to know the
following fact.

\item Let $X_1,\cdots,X_n$ be a random sample from
$N(\mu,\sigma^2)$.
$$ \frac{(n-1)S^2}{\sigma^2} = \frac{1}{\sigma^2}\sum_{j=1}^n(X_j
- \bar X)^2 \sim \chi_{n-1}^2$$ Quiz. What is the expectation of
$\chi_{n-1}^2$?

\begin{verbatim}
> y<- 0:50
> par(mfrow=c(2,2))
> plot(y,dchisq(y,1),type='l')
> plot(y,dchisq(y,5),type='l')
> plot(y,dchisq(y,10),type='l')
> plot(y,dchisq(y,20),type='l')
\end{verbatim}
\begin{figure}[t]
\centering
\includegraphics[width=80mm]{lecture10-1.ps}
\caption{The density functions of $\chi_1^2, \chi_5^2,
\chi_{10}^2,\chi_{20}^2$ respectively.}
\end{figure}

\item Critical values for $\chi_n^2$ distribution are defined as numbers that
gives
$$P(\chi_{1-\alpha/2,n}^2 < \chi_n^2 < \chi_{\alpha/2,n}^2)= 1
-\alpha$$ To find $\chi_{0.975,9}^2$ and $\chi_{0.025,9}^2$ that is
need to construct $95\%$ CI for $\sigma^2$, we use {\tt R} package:
\begin{verbatim}
> qchisq(0.025,9)
[1] 2.700389
> qchisq(0.975,9)
[1] 19.02277
\end{verbatim}




\item $100(1-\alpha)\%$ CI for $\sigma^2$:
$$\frac{(n-1)}{\chi_{\alpha/2,n-1}^2}s^2 < \sigma^2 <
\frac{(n-1)}{\chi_{1-\alpha/2,n-1}^2}s^2$$
\end{enumerate}

{\em Review problems.} Example 7.15., Excercise 7.45.\\
Exercise 7.47. Additional problem for lecture 09.
\begin{verbatim}
> library(Devore6)
>  data(ex07.47)
> attach(ex07.47)
> ex07.47
   strength
1      11.5
2      12.1
3       9.9
4       9.3
....
> a<-(strength>10)
> a
 [1]  TRUE  TRUE FALSE FALSE...
> length(a)
[1] 48
> sum(a)
[1] 13
\end{verbatim}



\end{document}
