> For the complete documentation index, see [llms.txt](https://kerasnoone.gitbook.io/garnet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kerasnoone.gitbook.io/garnet/shu-xue-ji-chu/gai-shuai-lun/tong-ji-tui-duan/0x02-can-shu-gu-ji/0x02-dan-ge-zong-ti-can-shu-de-qu-jian-gu-ji.md).

# 0x02 单个总体参数的区间估计

## 总体均值的区间估计

研究一个总体时, 关心:

* 总体均值$$\mu$$
* 总体方差$$\sigma^2$$
* 总体比例$$\pi$$

需要考虑的条件有:

* 总体是否为正态分布
* 总体方差是否已知
* 构造估计量的样本的样本容量($$n\ge30$$为大样本, 反之为小样本)

### 正态总体, 方差已知

### 非正态总体, 大样本

这两种情况是一样的, 可以使用相同的方法进行估计. 这是因为在这两种情况下, 样本均值$$\bar{x}$$的抽样分布为**正态分布**, 均值为$$\mu$$, 方差为$$\sigma^2/n$$, 当总体的方差未知但大样本的情况下, 可以用**样本方差**$$s^2$$代替$$\sigma^2$$.

总体均值$$\mu$$, 在$$1-\alpha$$置信水平下, 置信区间为:

$$\bar{x}\pm z\_{\alpha/2}\frac{\sigma}{\sqrt{n}}$$

其中$$\alpha$$为事先确定好的**风险值**, $$1-\alpha$$为**置信水平**, $$z\_{\alpha/2}$$是**标准正态分布**右侧面积为$$\alpha/2$$时的$$z$$值, $$z\_{\alpha/2}\frac{\sigma}{\sqrt{n}}$$是估计总体均值时的**估计误差**.

### 正态总体, 方差未知, 小样本

这时的样本均值$$\bar{x}$$的抽样分布仍是正态分布, 但由于总体的方差未知, 又是小样本, 不能直接使用**样本方差**$$s^2$$代替$$\sigma^2$$. 构造:

$$t=\frac{\bar{x}-\mu}{s/\sqrt{n}}\sim t(n-1)$$

则样本均值经过**标准化**以后的随机变量服从自由度为$$n-1$$的$$t$$分布. 因此, 使用$$t$$分布连建立总体均值$$\mu$$的置信区间:

$$\bar{x}\pm t\_{\alpha/2}\frac{s}{\sqrt{n}}$$

其中$$t\_{\alpha/2}$$是自由度为$$n-1$$的$$t$$分布右侧面积为$$\alpha/2$$时的$$t$$值, 可以通过查表获得.

观察与上面使用正态分布构建置信区间方法, 其单位误差都为$$\frac{s}{\sqrt{n}}$$, 但倍数分别为$$z\_{\alpha/2}$$和$$t\_{\alpha/2}$$, 来自于不同的分布.

## 总体比例的区间估计

只讨论**大样本**情况下总体比例的估计问题. 判断是否为大样本的标准有:

* 区间$$p\pm 2\sqrt{p(1-p)/2}$$不包含0和1
* $$np\ge5$$且$$n(1-p)\ge5$$

当样本量足够大时, 比例$$p$$的抽样分布近似于正态分布. 期望为$$E(p)=\pi$$, 方差为$$\sigma^2\_p=\frac{\pi(1-\pi)}{n}$$, **样本比例**标准化之后服从**标准正态分布**, 即:

$$z=\frac{p-\pi}{\sqrt{\pi(1-\pi)/n}}\sim N(0,1)$$

因此, 总体比例$$\pi$$在$$1-\alpha$$置信水平下的置信区间为:

$$p\pm z\_{\alpha/2}\sqrt{\frac{\pi(1-\pi)}{n}}$$

上式要求$$\pi$$是已知的, 但这正是我们要估计的, 因此用样本比例$$p$$来代替$$\pi$$(大样本保证):

$$p\pm z\_{\alpha/2}\sqrt{\frac{p(1-p)}{n}}$$

## 总体方差的区间估计

只讨论正态总体的方差估计问题. 前面表明, 样本方差服从自由度为$$n-1$$的$$\chi^2$$分布, 因此用$$\chi^2$$分布构造总体方差的置信区间.

给定一个显著性水平$$\alpha$$, 则总体方差$$\sigma^2$$的置信区间满足:

$$\chi^2\_{1-\alpha/2}\le\chi^2\le\chi^2\_{\alpha/2}$$

又由于$$\frac{(n-1)s^2}{\sigma^2}\sim \chi^2(n-1)$$, 用左侧的表达式来代替$$\chi^2$$, 有:

$$\chi^2\_{1-\alpha/2}\le\frac{(n-1)s^2}{\sigma^2}\le\chi^2\_{\alpha/2}$$

得到置信区间为:

$$\frac{(n-1)s^2}{\chi^2\_{\alpha/2}}\le\sigma^2\le\frac{(n-1)s^2}{\chi^2\_{1-\alpha/2}}$$


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://kerasnoone.gitbook.io/garnet/shu-xue-ji-chu/gai-shuai-lun/tong-ji-tui-duan/0x02-can-shu-gu-ji/0x02-dan-ge-zong-ti-can-shu-de-qu-jian-gu-ji.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.
