# Confidence Intervals for Normal Data

## Introduction

On its own, a point estimate like $$\bar{x}=2.2$$ carries no information about its accuracy; it's just a single number, regardless of wheter its based on ten data points or one million data points.

For this reason, statisticians augment point estimates with confidence intervals. For example, to estimate unknown mean $$\mu$$ we might be able to say that our best estimate of the mean is $$\bar{x}=2.2$$ with a $$95%$$ confidence interval $$\[1.2, 3.2]$$.

## Interval Statistics

Recall that our working definition of a statistic is anything that be computed from data. In particular, the formula for a statistic cannot include unknown quantities.

Technically an interval statistic is nothing more than a pair of point statistics giving the lower and upper bounds of the interval. Our reason for emphasizing that the **interval is a statitic** is to highlight the folliwng:

1. The interval is random - new random data will produce a new interval.
2. As frequentists we are perfectly happy uisng it because it doesn't depend on the value of an unknown parameter or hypothesis.
3. Be careful in you thinking about these probabilities. Confidence intervals are a frequentist notion. Since frequentists do not compute probabilities of hypotheses, the confidence level is never a probability that the unknown parameter is in the confidence level.

**Example) 사과농장의 사과 수확량**\
**Q1)** 사과 농장에서 한 해 20만개의 사과를 수확하였다. 올해 수확한 사과 20만개의 평균무게를 알고 싶어서 20만개의 사과 중 36개를 무작위로 뽑아서 무게를 쟀다. Sample 로 뽑은 36개 사과의 평균무게는 112g이고 표준편차는 40g이다. (사과의 무게는 정규분포를 따른다고 가정함) 사과무게 모평균의 95% 신뢰구간을 구하면?

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-888beff6aa10ebe57a0e681734a4854107608fe6%2Fimage.png?alt=media)

**Q2**) 사과를 무작위로 36개를 다시 뽑을 경우 첫 번째 36개와 같은 샘플평균이 나오게 될까?

NO!!!. 즉, 추출된 표본이 정해진 개념이 아니듯 신뢰구간 또한 명확히 정해지는 개념이 아님.

{% hint style="info" %}
따라서, 신뢰구간 95%의 정확한 의미는 '**같은 방법으로 100번 표본을 추출했을 때, 함계 계산되는 100개의 신뢰구간 중 모평균을 포함한 신뢰구간들의 숫자가 95개 정도 된다**.'는 의미이다.
{% endhint %}

## $$z$$ Confidence Interval for the Mean

Throughout this page, we will assume that we have **normally distributed data**:

$$
x\_1,\ x\_2, . . .,\ x\_n \sim N(\mu, \sigma^2)
$$

{% hint style="info" %}
Ref) [Critical Value](https://www.statisticshowto.com/probability-and-statistics/find-critical-values/), [Student-t critical values](https://people.richland.edu/james/lecture/m170/tbl-t.html)
{% endhint %}

### Definition of $$z$$ confidence intervals for the mean

Suppose the data behaves normal distribution, with unknown mean $$\mu$$ and known variance $$\sigma^2$$ . The $$(1-\alpha)$$ confidence interval for $$\mu$$ is

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-0be66182d0c90bdc575c0af7386bdd4af4dd6aa0%2Fimage.png?alt=media)

For example, if $$\alpha=0.05$$ then $$z\_{\alpha/2}=1.96$$ so the 0.95(or 95%) confidence interval is

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-3767210e69b0d1c6d2893cb98196114e131aeeb5%2Fimage.png?alt=media)

**Example**) Suppose we collect 100 data points from $$N(\mu, 3^2)$$ distribution and the sample mean is $$\bar{x}=12$$ . Give the 95% confidence interval for $$\mu$$ .

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-cc8e80e9727ac473f92e8ea68d15134a2e3d1d86%2Fimage.png?alt=media)

### Rejection regions

**Example**) Suppose that $$n=12$$ data points are drawn from $$N(\mu, 5^2)$$ where $$\mu$$ is unknown. Set up a two-sided significance test of $$H\_0 :\mu=2.71$$ using the statistic $$\bar{x}$$ at significance level $$\alpha=0.05$$. Describe the rejection and non-rejection regions.

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-ad44485038ba2dee4964e311997f28a886843f03%2Fimage.png?alt=media)

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-c54aea709e19d952a93c0486d1049a88ba4e5555%2Fimage.png?alt=media)

###

### Manipulating intervals: pivoting

Here is a quick summary of intervals $$\bar{x}$$ and $$\mu\_0$$ and what is called **pivoting**. Pivioting is the idea the $$\bar{x}$$ is in $$\mu\_0 \pm a$$ says exactly the same thing as $$\mu\_0$$ is in $$\bar {x} \pm a$$ .

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-02b77c9b8d9f44cf73c5904a6575b432fa330cc8%2Fimage.png?alt=media)

We make a few observations about this confidence interval.

1. It only depnds on $$\bar {x}$$ , so it is a statistic.
2. The significance level $$\alpha=0.05$$ means that, assuming the null hypothesis that $$\mu=2.71$$ is ture, random data will lead us to reject the null hypothesis 5% of the time (a Type 1 error).
3. Again assuming that $$\mu=2.71$$ , then 5% of the time the confidence interval will not contain 2.71, and conversely, 95% of the time it will contain 2.71.

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-3ae75fe523d82b135f783c055d47d65b63865292%2Fimage.png?alt=media)

**Example**) Suppose the data 2.5, 5.5, 8.5, 11.5 was drawn from a $$N(\mu, 10^2)$$ distribution with unkown mean $$\mu$$ .

(a) Compute the point estimate $$\bar{x}$$ for $$\mu$$ and the corresponding 50%, 80%, 95% confidence intervals.\
(b) Consider the null hypothesis $$\mu=1$$ . Would you reject $$H\_0$$ at $$\alpha=0.05$$? $$\alpha=0.20$$?$$\alpha=0.50$$ ? Do these two ways: first by checking if the hypothesized value of $$\mu$$ is in the relevant confidence intervals and second by constructing a rejection region.

## $$t$$-confidence Interval for the mean

This will nearly identical to normal confidence intervals. In this setting $$\sigma$$ **is not known**, so we have to make the following replacements.

1. Use $$s\_{\bar x}= {s \over \sqrt n}$$ instead of $$\sigma\_{\bar x}= {\sigma \over \sqrt n}$$ . Here $$s$$ is the sample variance we used before in *t*-tests.
2. Use *t*-critical values instead of *z*-critical values.

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-b7ad5e542f6056c13c3476aa489a17e92046f915%2Fimage.png?alt=media)

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-3aecaed3b370ea6ddce177ff0869b5cb30e6c941%2Fimage.png?alt=media)

## Chi-square Confidence Interval for the Variance

{% hint style="info" %}
Ref) [Chi-square confidence interval](https://faculty.elgin.edu/dkernler/statistics/ch09/9-3.html)
{% endhint %}

We now turn to an interval estimate for the unknown variance.

**Definition**: Suppose the data $$x\_1,\ x\_2, . . .,\ x\_n \sim N(\mu, \sigma^2)$$ with $$\mu$$ and $$\sigma$$ both unknown. The $$(1-\alpha)$$ confidence interval for the variance $$\sigma ^2$$ is

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-19608d7485fe92fabc7a6ec6bd6d387230137272%2Fimage.png?alt=media)

Here $$c\_{\alpha/2}$$ is the right critical value $$P(X^2>c\_{\alpha/2})=\alpha/2$$ for $$X^2 \sim \chi^2(n-1)$$ and $$s^2$$ is the sample variance of the data.

![](https://3698175758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAwtzMy_pbrChIExFtN%2Fuploads%2Fgit-blob-a0fd9ba5cc7ad11e8352ff24ef2b7297a4bd31ab%2Fimage.png?alt=media)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ykkim.gitbook.io/wiki/machine-learning/probability-and-statistics-for-machine-learning/confidence-intervals-for-normal-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
