PRML Notes - 3.3 Bayesian Linear Regression

Chilly_Rain posted @ 2012年5月20日 00:36 in Pattern Recognition and Maching Learning , 1937 阅读

贝叶斯框架下的线性回归解决了频率框架下出现的过拟合问题,它是通过在推演阶段对参数引入先验分布,以及在决策阶段对参数值做积分来实现的。

参数分布

假设噪声精度\( \beta \)是已知的,那么似然性函数\( p(t|\mathbf{w}) \)就是一个未知参数\( \mathbf{w} \)的二次函数的幂。根据第二章的内容,其对应的共轭先验分布为正态分布

\[ p(\mathbf{w}) = N(\mathbf{w} | m_0, S_0) \]

而其后验分布同样也是正态分布

\[ p(\mathbf{w}|\mathbf{t}) = N(\mathbf{w} | m_N, S_n)  \]

\[ m_N = S_N (S_0^{-1} m_0 + \beta \Phi^{T} \mathbf{t}) \]

\[ S_N^{-1} = S_0^{-1} + \beta \Phi^{T} \Phi  \]

最 大后验参数值\( \mathbf{w}_{MAP} = \mathbf{m}_N\),当先验的方差无穷大时,即\( S_0 = \alpha^{-1} \mathbf{I}, \alpha -> 0 \)时,后验分布的均值就退化成了最大似然估计值。类似地,当N=0时,后验分布就退化成了先验分布。当数据点是一个接一个获得时,上次计算得到的后验分 布就可以作为下次计算时的先验分布,从而达到顺序计算的效果。

如果假设先验分布是一个零期望等方差的正态分布,那么其形式可以表示为

\[ p(\mathbf{w}) = N(\mathbf{w} | 0, \alpha^{-1} \mathbf{I}) \]

\[ m_N = \beta S_N  \Phi^{T} \mathbf{I} \]

\[ S_N^{-1} = \alpha \mathbf{I} + \beta \Phi^{T} \Phi  \]

根据贝叶斯定理,后验分布的对数可以表达为似然的对数,加上先验分布的对数,最终形成一个参数\( \mathbf{w} \)的函数,其形式是一个带规则化项的误差函数,其规则化项前的系数为\( \lambda = \alpha / \beta\)。

\[ ln p(w|t) = -\frac{\beta}{2} \sum_{n=1}^{N} (t_n - w^T \phi(x_n))^2 - \frac{\alpha}{2} w^T w + const \]

一般化的正态先验

\[ p(w|\alpha) = [\frac{q}{2} (\frac{\alpha}{2})^{1/q}]^M exp(-\frac{\alpha}{2} \sum_{j=1}^{M} |w_j|^q) \]

预测分布

在得到了参数的后验分布之后,我们并不做实际做些什么,真正要得到的是预测分布,即结合参数的后验分布来为新的输入做出合适的预测值。

\[ p(t|\mathbf{t},\alpha,\beta) = \int p(t|\mathbf{w},\beta) \dot p(\mathbf{w}|\mathbf{t},\alpha,\beta)dw \]

其中忽略了输入向量\(x\)以简化表达式。可以发现这个等式的右侧实际是两个正态分布的卷积,因而其结果也是一个正态分布,其期望和方差分别为

\[ \mu = \mathbf{m}_{N}^{T}\mathbf{S}_{N} \mathbf{\phi}(x) \]

\[ \sigma^2_{N}(x) = \frac{1}{\beta} + \phi^{T} (x) \mathbf{S}_{N} \phi (x) \]

期望值即为参数后验的期望与输入向量的内积;而方差值则可以分为两项,前者为数据噪声所引起的波动,而后者则可以看作参数值\( \mathbf{w} \)的波动,二者是独立可累加的。可以证明方差值是随着N值的变大而递减并趋向于0的,当样本足够大时,预测值的波动仅由训练数据中的噪声所带来。

预测分布的方差在训练数据点的附近最小,因而当数据点足够多时,预测分布的波动性也随之降低。

更一般地,如果参数\(w, \beta\)都被看作未知的,那么共轭先验就应该是一个Gaussian-gamma分布,而对应的预测分布就是一个学生t分布。

Equivalent Kernel

预测分布在一个点上的预测期望值可以表示为

\[ y(\mathbf{x},\mathbf{m}_{N}) = \mathbf{m}^{T}_{N} \mathbf{\phi}(\mathbf{x}) = \sum_{n=1}^{N}k(x, x_n)t_n\]

其中定义函数

\[ k(x,x') = \beta \phi(x)^{T} \mathbf{S}_{N}\phi(x') \]

这个函数称为平滑矩阵或者equivalent kernel,而回归函数可以表达为训练数据响应值的线性加权,因而被称为线性平滑。特别地,当待预测点距离某训练数据点近时,该点的响应时对应的权重就高,反之则小(核函数的局部属性)。

可以观察两个待预测点的预测方差之间的关系

\[ cov(y(x), y(x')) = cov(\phi(x)^{T} w, w^{T} \phi(x')) = \phi(x)^{T} \mathbf{S}_N \phi(x') = \beta^{-1}k(x,x')\]

其中cov是相对于w来说的。上式说明,在输入空间中相邻的两个点的预测期望值相关性较大,相反地,相距较远的两个点之间则相关性较小。

核函数给了我们一种新的思路,即不通过定义基函数和回归来实现预测,而是定义一个核函数,并使用训练数据的输出做线性加权而得到。(高斯过程)

该核函数还满足归一化的性质,但是并不保证其中的每个子项都非负。

\[ \sum_{n=1}^{N} k(x,x_n) = 1\]

另外还有一个核函数都满足的特征(不限于Equivalent Kernel),它们都可以表达为非线性函数的乘积的形式

\[ k(x,z) = f(x) f(z)\]

\[f(x) = \beta^{1/2} \mathbf{S}^{1/2}_{N}\phi(x) \]

 

Avatar_small
UK Jr Inter Model Pa 说:
2022年8月16日 20:50

Uttarakhand Board Model Paper 2023 Class 11 Pdf Download with Answers for English Medium, Hindi Medium, Urdu Medium & Students for Small Answers, Long Answer, Very Long Answer Questions, and Essay Type Questions to Term1 & Term2 Exams

Avatar_small
yono sbi registratio 说:
2022年10月27日 15:59

State bank of India Mobile banking (SBI Yono) is among the digital developments in the tech industry. Banking and financial institutions are utilizing the platform to ease funds transactions from one point to the other. yono sbi registration with atm card The platform is modified to accommodate all users. Since most people have smartphones and computer devices. The user needs to download, install and launch the mobile app to conduct banking operations.

Avatar_small
Jharkhand Bhu Naksha 说:
2022年11月03日 16:42

The Jharkhand state government uses high technology to produce land recording services for state citizens. The state has a digitalized land system that secures all land information, both past and recent. Jharkhand Bhu Naksha An exclusive website portal, the Jharbhoomi portal, contains land details such as Apna Khata and Bhu Naksha (land maps), Khatian registration, and more. Landowners, buyers, and interested Jharkhand citizens should log in to their account to retrieve land information.

Avatar_small
modelpaper2021.in 说:
2023年7月02日 10:17

For all age groups, our reporting team plans to publish the Education & Recruitment Update and provide inside coverage to show the real picture of current occurrences. Our goal is to meet the needs of people of all ages, thus we plan to publish news that is divided into categories like general, political,modelpaper2021.in crime, sports, entertainment, education, and world news.Dedicated news coverage of the most recent events in the nation.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter