# Confidence Interval

A confidence interval (CI) is a range of estimates for an unknown parameter.

The goal is to fix a probability, and then find an interval where $100∗p$% of such intervals conform to the parameter of interest.

Isn’t that what we did for the Likelihood Interval??

$θ$ - unknown parameter (a constant i.e $mu,σ,σ_{2},λ$, etc), $θ$ - estimate to $θ$ → a # calculated based on data - $μ ,λ,θ$, etc. $θ~$ - a RV that corresponds to $θ$ - RV of which $θ$ is an outcome

Confidence Interval (Definition)

A $100∗p$% Confidence Interval for $θ$ is an estimate of the interval

$[L,U]$ for RVs, $L(Y_{1},...,Y_{n})$ and $U(Y_{1},...,Y_{n})$, such that $P(L(Y_{1},…,Y_{n})<θ<U(Y_{1},…,Y_{n}))=p$

The interval $[l(y_{1},…,y_{n}),u(y_{1},…,y_{n})]=100∗p%$

### Interpretation of Confidence Intervals

Suppose we have a 95% CI: $θ±a$, where $θ=20$, $a=10$ $20±10⟹[10,30]←over 95 percent CI$ does NOT mean there is a 95% chance that the the $[10,30]$ interval contains the parameter. Instead, 95% of constructed CIs fall around (contain) the mean.

It means that 95% of intervals will contain $θ$

Also see Interval Estimation.

### Example

Suppose that we have $Y_{1},…Y_{25}∼N(μ,144)$ and we have collected ${y_{1},...,y_{25}}$ and $y $.

Construct the 95% Confidence Interval for $μ$.

We will do this in 3 steps:

- Construct the Pivotal Quantity
- Using the Pivotal Distribution, construct the Coverage Interval
- Estimate the coverage interval using your data

##### Step 1: Construct the Pivotal Quantity

The Pivotal quantity is given by $Z=n σ Y−μ $ From the above, we known $σ_{2}=144$, and $n=25$, therefore $n σ =512 $ $Y∼N(μ,25144 )⟹512 Y−μ =Z∼N(0,1)$

##### Step 2: Using the Pivotal distribution, construct the Coverage interval

Since we want the 95% confidence interval, we look at the $N(0,1)$ quantiles in the Z-Table for and find a value of of $1.96$ for $p=0.975$. We do this because we want the centered around the mean.

Make sure to draw your Normal Distribution, writing down your numbers to really convince yourself.

- The general trick is just say, they ask you for the Y% interval. You should take the values $[−(Y+21−Y ),(Y+21−Y )]$ as your bounds. Therefore, we get that $P(−1.96<Z<1.96)=0.95$ We then isolate for $μ$: $⟹P(Y−1.96×512 <μ<Y+1.96×512 )$

##### Step 3: Estimate the Coverage Interval using your data

Best estimate of $Y$ is $y $ $CI=y ±an σ $

- where $n σ $ is the Standard Error

So we obtain our final answer after fitting int he data:

$CI=75±1.96(512 )$

### Normal Confidence Intervals

I guess this is a summary of what we just did above? $Y_{1},…,Y_{n}∼N(μ,σ_{0})$

- $μ$ and $σ_{0}$ are known parameters here $⟹Y∼N(μ,n σ_{0} )$ $P(−z_{∗}<n σ y −μ <z_{∗})=p$ $y ±z_{∗}n σ_{0} $
- The general format the the above is Mean $±$ critical value * Standard Error

### Unknown $μ$ and $σ_{2}$

However, sometimes, $μ$ and $σ_{2}$ are unknown to us. In these cases, we can still find the Confidence Interval for both parameters.

If $Y_{1},…,Y_{n}$ are i.i.d. $N(μ,σ_{2})$, $Y=n1 ∑_{i=1}Y_{i}$ and $S_{2}=n−11 ∑_{i=1}(Y_{i}−Y)_{2}$ then

We can write this in terms of the Student’s t-Distribution to estimate the Student’s t-Distribution to estimate the Mean: $n S Y−μ ∼T(n−1)$ We can also write this in terms of the Chi-Squared Distribution to estimate the Chi-Squared Distribution to estimate the Variance: $σ_{2}(n−1)S_{2} ∼χ_{2}(n−1)$

The above notation is confusing, so just some clarification:

- $Y$ and $S$ are RVs, $y $ and $s$ and estimates
- The estimate of $S_{2}$ is $s_{2}$. We say that $S_{2}$ is an Unbiased Estimator of $σ_{2}$ but $σ_{2}$ is biased.
- Basically, $s_{2}$ is what we actually see in our data, and to get it to be unbiased, we reduce it by one degree of freedom

#### CI for $μ$

$Y_{1},…,Y_{n}∼N(μ,σ_{2}),μ,σ$ are unknown.

A sample of 16 students were taken and it was calculated that $y =75$ and $s_{2}=100$. Find a 90% CI for $μ$.

Step 1: Construct the Pivotal Quantity We have that $16 10 Y−μ ∼T(16−1)$ Coverage Interval: 90% CI, and 15 DOF, looking at our t-table, we actually need to use the value that is for p=0.95 and $dof=15$.

$P(−1.75<T(15)<1.75)=0.9$ $P(Y−1.7516 10 <μ<y +1.75∗16 10 )=0.9$ $y ±z_{∗}n σ_{0} $ Confidence Interval: $y ±1.7516 10 =75±4.375$

#### CI for $σ_{2}$

**Pivotal Quantity:**
If $Y_{1},…,Y_{n}$ are i.i.d. $N(μ,σ_{2})$, $Y=n1 ∑_{i=1}Y_{i}$ and $S_{2}=n−11 ∑_{i=1}(Y_{i}−Y)$ then
$σ_{2}(n−1)S_{2} ∼χ_{2}(n−1)$

**Coverage Interval**: $[a(n−1)S_{2} ,b(n−1)S_{2} ]$
**Confidence Interval:** $[a(n−1)S_{2} ,b(n−1)S_{2} ]$

### Binomial CI

If $Y∼Bin(n,θ)$, then we have following results:

Pivotal Quantity $Y∼N(nθ,nθ(1−θ))$ Pivotal Distribution $nθ(1−θ) Y−nθ =Z∼N(0,1)$ Coverage Interval $θ~±z_{∗}nθ~(1−θ~) $ Confidence Interval $θ~±z_{∗}nθ~(1−θ~) $

### Poisson CI

If $Y_{1},…,Y_{n}∼Poi(θ)$, then we have following results: Pivotal Quantity $Y∼N(θ,nθ )$ Pivotal Distribution $nY Y−θ =Z∼N(0,1)$ Coverage Interval $Y±z_{∗}nY $ Confidence Interval $y ±z_{∗}ny $