> For the complete documentation index, see [llms.txt](https://zhjunqin.gitbook.io/machine-learning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zhjunqin.gitbook.io/machine-learning/ji-qi-xue-xi/shu-xue-ji-chu/gai-lv-tong-ji/yang-ben-tong-ji-liang.md).

# 样本统计量

设$$X\_1$$，$$X\_2$$，...，$$X\_n$$是来自总体$$X$$（随机变量）的一个样本，它们相互独立，$$g(X\_1,X\_2,...,X\_n)$$是$$X\_1$$，$$X\_2$$，...，$$X\_n$$的函数，若$$g$$中不含未知参数，则称$$g(X\_1,X\_2,...,X\_n)$$是一**统计量**。

因为$$X\_1$$，$$X\_2$$，...，$$X\_n$$都是随机变量，而统计量是随机变量的函数，因此统计量是一个随机变量。设$$x\_1,x\_2,...,x\_n$$是相应于样本$$X\_1$$，$$X\_2$$，...，$$X\_n$$的样本值，则称$$g(x\_1,x\_2,...,x\_3)$$是$$g(X\_1,X\_2,...,X\_n)$$的**观察值**。

**样本均值**：

$$
\overline{X}=\frac{1}{n}\displaystyle\sum\_{i=1}^{n} X\_i
$$

**样本方差（无偏估计）**：

$$
S^2=\frac{1}{n-1}\displaystyle\sum\_{i=1}^{n} (X\_i-\overline{X})^2=\frac{1}{n-1}(\displaystyle\sum\_{i=1}^{n} X\_i^2-n\overline{X}^2)
$$

**样本标准差**：

$$
S=\sqrt{S^2}=\sqrt{\frac{1}{n-1}\displaystyle\sum\_{i=1}^{n} (X\_i-\overline{X})^2}
$$

**样本**$$k$$**阶（原点）距**：

$$
A\_k=\frac{1}{n}\displaystyle\sum\_{i=1}^{n} X\_i^k
$$

**样本**$$k$$**阶中心距**：

$$
A\_k=\frac{1}{n}\displaystyle\sum\_{i=1}^{n} (X\_i-\overline{X})^k
$$

**样本的协方差：**

$$
Cov(X,Y)=\frac{1}{n-1}\displaystyle\sum\_{i=1}^{n} (X\_i-\overline{X})(Y\_i-\overline{Y})
$$

其中$$X\_1$$，$$X\_2$$，...，$$X\_n$$是来自总体$$X$$的一个样本，$$Y\_1$$，$$Y\_2$$，...，$$Y\_n$$是来自总体$$Y$$的一个样本。

**样本协方差矩阵：**

假定$$X\_1$$，$$X\_2$$，...，$$X\_n$$是多维随机变量

$$
c\_{ij}=Cov(X\_{i},X\_{j})=\frac{1}{n-1}\displaystyle\sum\_{k=1}^{n} (X\_{ik}-\overline{X\_i})(X\_{jk}-\overline{X\_j})
$$

$$
C=\begin{bmatrix}
c\_{11} & c\_{12} & ... & c\_{1n}  \\
c\_{21} & c\_{22} & ... & c\_{2n} \\
\vdots & \vdots & & \vdots \\
c\_{n1} & c\_{n2} & ... & c\_{nn}
\end{bmatrix}
$$

> 为什么样本方差是除以$$n-1$$，而不是$$n$$？
>
> “均值已经用了$$n$$个数的平均来做估计，在求方差时，只有$$n-1$$个数和均值信息是不相关的。而第$$n$$个数已经可以由前$$n-1$$个数和均值来唯一确定，实际上没有信息量，所以在计算方差时，只除以$$n-1$$“
>
> （详细请参考 <https://www.zhihu.com/question/20099757）>


---

# 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://zhjunqin.gitbook.io/machine-learning/ji-qi-xue-xi/shu-xue-ji-chu/gai-lv-tong-ji/yang-ben-tong-ji-liang.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.
