参数与非参数模型
统计推断(Statistical inference),在计算机科学中也称为学习,是利用数据推测其分布的方法。即给定样本 $X_1 , X_2,\cdots , X_n \sim F$ ,推断出 $F$
我们观测到的相关随机变量值 $\mathbf {X} = (X_1 , X_2,\cdots , X_n)$ 称为 观测值、测量值、观测向量(observation)
参数化模型(parametric model)能够通过一组有限参数描述。
非参数化模型:有限参数无法描述。
参数模型的通用形式:
$$
\mathfrak{F} = \left\{ f(x; \theta) : \; \theta \in \Theta \right\}
$$
- $\theta$ 是一个未知参数,其可以在 参数空间(parameter space) $\Theta$ 中取值.
- 若 $\theta $ 是向量,则其中我们不关心的分量称为 冗余参数。
若有分布 $X_1, \cdots ,X_n \sim F$ ,则任何 $F$ 的函数称为 统计泛函
假设我们有数据对 $ (X_1, Y_1) , \cdots (X_n, Y_n) $ 。假设 $X_i$ 表示病人 $i$ 的血压,$Y_i$ 表示病人的寿命。
则 $X$ 称为预测变量(predictor),或者 回归值(regressor),或者特征(feature),或者独立变量(independent variable),
$Y$ 称为结果(outcome),或者响应变量(response variable)或者 独立变量(dependent variable)。称 $r (x) = \mathbb {E}(Y | X = x)$ 为回归方程(regression function)。
若假设 $r \in \mathfrak {F}$
- 若 $\mathfrak {F}$ 是有限维度的,比如直线的几何,则我们得到一个参数回归模型。
- 若 $\mathfrak {F}$ 是无限维度的,则我们得到一个 非参数回归模型。
基于新病人的 $X$ 值,预测 $Y$ 值的过程称为预测。(废话?)
若 $Y$ 是离散值,则预测是分类(classification)。
若 $Y$ 是连续值,则预测是回归(regression)或者曲线估计(curve estimation)
回归模型有时可以写作:
$$
Y = r(X) + \epsilon
$$
其中 $\mathbb {E}(\epsilon) = 0$。
统计推断的基本概念
估计器、估计子(estimator)是 随机变量 :
$$
\hat{\theta }_n = g(\mathbf{X})
$$
它是关于观测向量的函数。
其期望和方差记为 $\mathbb {E}(\hat {\theta}_n)$,$\mathbb {V}(\hat {\theta}_n)$
估计误差(estimation error)记为:
$$
\tilde{\theta }_{n}=\hat{\theta }_{n}-\theta
$$
估计器的偏差(bias of an estimator)定义为:
$$
\operatorname{bias}(\hat{\theta }_n) = \mathbb{E}_ \theta (\hat{\theta _n}) - \theta
$$
若 $\mathbb {E}(\hat {\theta}_n) = \theta $ ,则称 $\hat {\theta}_n$ 是无偏的估计器。即
如果平均估计误差是零,则得到一个无偏的估计器
称 $\hat {\theta}_{n}$ 渐近无偏, 若 $\lim _{n \rightarrow \infty} \mathrm {E}_{\theta}\left [\hat {\theta}_{n}\right]=\theta$ 对于 $\theta$ 所有可能的取值都成立
$\hat {\theta}_n$ 的标准偏移(standard deviation)为 标准误差(standard error),记作 $\operatorname {se}$ :
$$
\operatorname{se} =\operatorname{se}\left(\hat{\theta}_{n}\right)=\sqrt{\mathbb{V}\left(\hat{\theta}_{n}\right)}
$$
均方误差(MSE):
$$
\operatorname{MSE} = \mathbb{E}_{\theta}\left[\tilde{\theta}_{n}^{2}\right] = \mathbb{E}_{\theta} \left[( \hat{\theta }_{n}-\theta ) ^2\right]
$$
用于评估点估计的好坏。
定理:
$$
\operatorname{MSE} = \operatorname{bias}^2(\hat{\theta }_n) + \mathbb{V_ \theta }(\hat{\theta }_n)
$$
证明
令 $\\bar {\\theta}\_{n}=\\mathbb {E}\_{\\theta}\\left (\\hat {\\theta}\_{n}\\right)$, 则
$$
\begin{aligned} \mathbb{E}_{\theta}\left(\hat{\theta}_{n}-\theta\right)^{2} &=\mathbb{E}_{\theta}\left(\hat{\theta}_{n}-\bar{\theta}_{n}+\bar{\theta}_{n}-\theta\right)^{2} \\
&=\mathbb{E}_{\theta}\left(\hat{\theta}_{n}-\bar{\theta}_{n}\right)^{2}+2\left(\bar{\theta}_{n}-\theta\right) \mathbb{E}_{\theta}\left(\hat{\theta}_{n}-\bar{\theta}_{n}\right)+\mathbb{E}_{\theta}\left(\bar{\theta}_{n}-\theta\right)^{2} \\
&=\left(\bar{\theta}_{n}-\theta\right)^{2}+\mathbb{E}_{\theta}\left(\hat{\theta}_{n}-\bar{\theta}_{n}\right)^{2} \\
&=\operatorname{bias}^{2}\left(\hat{\theta}_{n}\right)+\mathbb{V}_{\theta}\left(\hat{\theta}_{n}\right) \\
& = \operatorname{bias}^2 + \operatorname{se}^2
\end{aligned}
$$
注:$\mathbb {E}_{\theta}\left (\hat {\theta}_{n}-\bar {\theta}_{n}\right)=\bar {\theta}_{n}-\bar {\theta}_{n}=0$
定理:若 $\operatorname {bias} \to 0$ 且当 $n \to \infty $ 时成立 $\operatorname {se} \to 0$ ,则 $\hat {\theta}_n$ 是一致估计器,即 $\hat {\theta}_n \stackrel {P}{\longrightarrow} \theta $
定义:若
$$
\frac{\hat{\theta}_{n}-\theta}{\text { se }} \leadsto N(0,1)
$$
则称估计器 $\hat {\theta}_n$ 是渐进正态的。
置信集
参数 $\theta$ 的 $1-\alpha$ 置信区间(Confidence Interval)为区间 $C_{n}=(a, b)$, 其中,$a=a\left (X_{1}, \cdots, X_{n}\right), b=$ $b\left (X_{1}, \cdots, X_{n}\right)$ 是数据的函数,满足
$$
\mathbb{P}_{\theta}\left(\theta \in C_{n}\right) \geqslant 1-\alpha, \quad \theta \in \Theta .
$$
其含义为 $(a, b)$ 覆盖参数 $\theta $ 的概率为 $1-\alpha$, 称 $1-\alpha$ 为置信区问的覆盖(coverage).$C_{n}$ 是随机的而 $\theta$ 是固定的.
假设检验
我们通过投掷硬币来检验硬币是否均匀。
- 令 $H_0$ 表示硬币是均匀的假设。这称为原假设(或者缺省假设,或者零假设)。
- 令 $H_1$ 表示硬币不均匀的假设。这成为备择假设。
记作:
$$
H_{0}: p=1 / 2 \text { versus } H_{1}: p \neq 1 / 2
$$
如果 $T = \left| \hat {p}_n - (1/2) \right| $ 很大,则可以拒绝 $H_0$
置信区间例题 某区域有 6250 名教师。随机抽取了 250 个,调查其是否认为有必要配备教学计算机。有 142 人认为有必要。
- 为 “认为有必要” 的教师数量计算 99% 置信区间。
- 如何才能让调查改变后,置信区间变得更狭窄,却能维持 99% 置信度。
解答
我们定义 1 为 “认为有必要”,定义 0 为 “不认为有必要”。则这是一个两点分布
0 |============== | p 142
1 |========= | -1p 108
样本均值 $\dfrac {1 \cdot 142}{250} = 0.568$
样本方差 $s^2 = \dfrac {142 ( 1 - 0.568) ^2 + 108 (0 - 0.568)^2}{250 - 1} = 0.246$
则样本标准差 $s = \sqrt []{0.246} = 0.50$
所以抽样分布标准差 $\sigma _ \bar {x} = \sigma {\sqrt []{n}}$ . $\sigma$ 是总体标准差,我们不知道。
$$
\sigma {\sqrt[]{n}} \approx \frac{0.50}{\sqrt[]{250}} = 0.031
$$
查询 Z-table 得到面积应该是 $0.495 + 0.5 = 0.995$
$0.995$ 对应
♞1 Let $X_{1}, \ldots, X_{n} \sim$ Poisson $(\lambda)$ and let $\hat{\lambda}=n^{-1} \sum_{i=1}^{n} X_{i}$. Find the bias, se, and MSE of this estimator.
解答
$$
\begin{aligned}
\mathbb{E}_{\lambda}\left(\lambda_{n}\right) &=\mathbb{E}\left(n^{-1} \sum_{i=1}^{n} X_{i}\right) \\
&=n^{-1} \sum_{i=1} \mathbb{E}\left(X_{i}\right) \\
&=n^{-1}(n \cdot \lambda) \\
&=\lambda
\end{aligned}
$$
$$
\begin{aligned}
\mathbb{V} _{\lambda}\left(\hat{\lambda}_{n}\right) &=\mathbb{V}\left[n^{-1} \sum_{i=1}^{n} x_{i}\right] \\
&=n^{-2} \sum_{i=1}^{n} \mathbb{V} \left(x_{i}\right) \\
&=n^{-2} \cdot n \cdot \lambda \\
&=\frac{\lambda }{n}
\end{aligned}
$$
$$
\operatorname{se} = \sqrt[]{\mathbb{V}_ \lambda (\hat{\lambda }_n)} = \sqrt[]{\dfrac{\lambda }{n}}
$$
$$
\operatorname{MSE} = \operatorname{bias}^2 + \operatorname{se} ^2 = \dfrac{\lambda }{n}
$$
♞2 Let $X_{1}, \ldots, X_{n} \sim \operatorname{Uniform}(0, \theta)$ and let $\widehat{\theta}=\max \left\{X_{1}, \ldots, X_{n}\right\}$. Find the bias, se, and MSE of this estimator.
♞3 Let $X_{1}, \ldots, X_{n} \sim \operatorname{Uniform}(0, \theta)$ and let $\widehat{\theta}=2 \bar{X}_{n}$. Find the bias, se, and MSE of this estimator.
参考
例题来源:
- https://open.163.com/newview/movie/free?mid=M83JCE4VK&pid=M82IC6GQU