% 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[12pt,twocolumn]{article} %,twocolumn
\usepackage[dvips]{graphicx,graphics,color}
\usepackage{times,amsmath,amsfonts}


\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}

% Add the period after section numbers.  Adjust spacing.

\newcommand{\bqn}{\begin{eqnarray}}
\newcommand{\eqn}{\end{eqnarray}}
\newcommand{\bq}{\begin{eqnarray*}}
\newcommand{\eq}{\end{eqnarray*}}

\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 06\\
 Confidence Intervals}

% 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 A {\em confidence interval} (CI) is an interval used to estimate
the likely size of a population parameter. A {\em confidence level}
is a measure of the degree of reliability of the confidence
interval. Most commonly used confidence levels are the 90$\%$,
95$\%$ and 99$\%$ confidence intervals that have 0.90, 0.95 and 0.99
probabilities respectively of containing the parameter.\\

Ex. For population parameter $\mu$, 95$\%$ confidence interval
$(\hat \mu_L,\hat \mu_U)$ of $\mu$ is an interval that satisfies
$$P( \hat \mu_L \leq \mu \leq \hat \mu_U)=0.95.$$
We usually make the interval centered so that
$$P( \hat \mu_L \leq \mu) = P(\mu \leq \hat \mu_U)=0.025.$$

\item Let $X_i \sim N(\mu,\sigma^2)$ with known $\sigma^2$ and unknown $\mu$. 95$\%$ {\em confidence interval} for $\mu$ is $$\hat \mu_L =\bar x - 1.96 \cdot \sigma/\sqrt{n},\; \hat \mu_U=\bar x + 1.96 \cdot \sigma/\sqrt{n}.$$

\item  Let $X_i \sim N(\mu,\sigma^2)$ with known $\sigma^2$ and unknown $\mu$. $100(1-\alpha)\%$ confidence interval for $\mu$ is.
$$\hat \mu_L =\bar x - z_{\alpha/2} \cdot \sigma/\sqrt{n},\; \hat \mu_U=\bar x + z_{\alpha/2} \cdot \sigma/\sqrt{n},$$
where quantile $z_{\alpha/2}$ is given by $$P\big(Z >
z_{\alpha/2}\big) = \frac{\alpha}{2}.$$


\item A $95\%$ confidence interval can be interpreted probabilistically
as an interval that can contain true unknown parameter $95\%$ of
time in the long run.  The following simulation demonstrates this.\\
Let $X_i \sim N(\mu,14^2)$. Suppose $\mu=42$ but assume we do not
know this fact. Let $n=10$. This is the binge drinking example of
Lecture 1.
\begin{verbatim}
> b=1.96*14/sqrt(10)
> b
[1] 8.67729

> a1<-rnorm(10,42,14)
> a1
  [1] 72.97298 39.29226 48.76871 52.01553 50.07126 46.61409 28.11466 32.81800
> c(mean(a1)-b,mean(a1)+b)
[1] 38.63614 55.99072

>  a2<-rnorm(10,42,14)
> c(mean(a2)-b,mean(a2)+b)
[1] 30.18341 47.53799

> c(mean(a3)-b,mean(a3)+b)
[1] 32.18435 49.53893

>  a4<-rnorm(10,42,14)
> c(mean(a4)-b,mean(a4)+b)
[1] 40.65048 58.00506

... If you this many many times .....

>  a17<-rnorm(10,42,14)
> c(mean(a17)-b,mean(a17)+b)
[1] 45.15059 62.50517
\end{verbatim}
\end{enumerate}
{\em Review problems.} Example 7.2.,7.3.


\end{document}
