% 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
%\usepackage[dvips]{graphicx,graphics}
%\usepackage{times,amsmath,amsfonts}

% Use following instead for LaTex 2.09 (may need some other mods as well).
% \documentstyle[times,twocolumn]{article}

% Set dimensions of columns, gap between columns, and paragraph indent
\setlength{\textheight}{9.2in} \setlength{\textwidth}{6.875in}
%\setlength{\columnsep}{0.3125in} \setlength{\topmargin}{0in}
\setlength{\headheight}{0in} \setlength{\headsep}{-1in}
\setlength{\parindent}{1pc}
\setlength{\oddsidemargin}{-.1875in}  % Centers text.
\setlength{\evensidemargin}{-.1875in}

% 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}}
\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 8\\
 Student's $t$-distribution}
% For single author (just remove % characters)
\author{Instructor's valentine gift to students :)\\
Moo K. Chung\\
mchung@stat.wisc.edu}
% For two authors (default example)
\maketitle
\thispagestyle{empty}
\section*{Concepts}
\begin{enumerate}

\item When $n$ large,
$$Z \sim \frac{\bar X -\mu}{S/\sqrt{n}} \sim N(0,1).$$

\item What if $n$ is small?
$$T \sim \frac{\bar X -\mu}{S/\sqrt{n}} \sim t_{n-1},$$
a t distribution with $n-1$ degrees of freedom (Review STAT311).

\item As $n \to \infty$, $t_{n} \to N(0,1)$.

\item Critical values:
$$P(-t_{\alpha/2,n-1} < T < t_{\alpha/2,n-1})=1-\alpha.$$

\item Suppose $X_1,\cdots,X_n \sim N(\mu,\sigma^2)$, where $\mu$
and $\sigma$ are unknown. $100(1-\alpha)$ CI for $\mu$ is
$$\bar x \pm t_{\alpha/2}s/\sqrt{n}.$$
\end{enumerate}

\section*{In-class problems}
\begin{verbatim}
> x<- -50:50/10
> plot(x,dt(x,1000),type='l')

> qt(.975, df = c(1:10,20,100,1000,10000))
 [1] 12.706205  4.302653  3.182449
 [4]  2.776445  2.570582  2.446912
 [7]  2.364624  2.306004  2.262157
[10]  2.228139  2.085963  1.983972
[13]  1.962339  1.960201
> qnorm(0.975)
[1] 1.959964
> pt(2.228,10)
[1] 0.9749941
\end{verbatim}
%\begin{figure}[t]
%\centering
%\renewcommand{\baselinestretch}{1}
%\includegraphics[scale=0.5]{tdensity.ps}
%\caption{$t_{1000}}
%\end{figure}

Example 7.12. Fat content of 10 randomly selected hot dogs.
Assuming that observations come from normal distribution, find a
95$\%$ CI for the population mean fat content.
\begin{verbatim}
> x<-c(25.2,21.3,22.8,17.0,29.8,21.0,
       25.5,16.0,20.9,19.5)
> sd(x)
[1] 4.13414
> mean(x)+qt(0.975,9)*sd(x)/sqrt(10)
[1] 24.85739
> mean(x)-qt(0.975,9)*sd(x)/sqrt(10)
[1] 18.94261
\end{verbatim}
Assuming $X_i \sim N(\mu,\sigma^2 = 4.13^2)$, find a $95\%$ CI for
$\mu$.
\begin{verbatim}
> mean(x)+qnorm(0.975)*4.13/sqrt(10)
[1] 24.45975
> mean(x)-qnorm(0.975)*4.13/sqrt(10)
[1] 19.34025
\end{verbatim}
\section*{Self-study problems}
Exercise 7.29., 7.33.
\section*{Assignment III.}
Due Feb 27, 11:00am.\\
Exercise 7.32, 7.34., 7.42., 7.44., 8.10.\\
The first midterm will cover chapters 6,7 and 8.1. Sample midterm
problems will be posted on Feb. 25.
\end{document}
