1、 公式(3.4)的推导。

可以直接对公式(3.3)中的$\beta_0$求导就得到$\hat{\beta}_0=\bar{y}-\beta_1\bar{x}$。

对公式(3.3)中的$\beta_0$求导会有:

$(y_1-\hat{\beta_0}-\hat{\beta_1}x_1)x_1+(y_2-\hat{\beta_0}-\hat{\beta_1}x_2)x_2\ldots+(y_n-\hat{\beta_0}-\hat{\beta_1}x_n)x_n$

将$\hat{\beta}_0=\bar{y}-\beta_1\bar{x}$代入上面的式子就有:

$\displaystyle \sum_{i=0}^n (y_i-(\bar{y}-\beta_1\bar{x})-\hat{\beta_1}x_i)x_i $

$\displaystyle = \sum_{i=0}^n (y_ix_i-\bar{y}x_i+\beta_1\bar{x}x_i-\hat{\beta_1}x_i^2) $    公式(1)

注意这样两个事实:

(a) $\displaystyle \sum_{i=0}^n \left(-x_i+\bar{x}\right)\bar{x}=\sum_{i=0}^n \left(-x_i\bar{x}+\bar{x}^2\right)=0$

(b) $\displaystyle \sum_{i=0}^n \left(-y_i+\bar{y}\right)\bar{x}=\sum_{i=0}^n \left(-y_i\bar{x}+\bar{y}\bar{x}\right)=0$

将这个两个等式代入到公式(1)中,则有

$\displaystyle  \sum_{i=0}^n\left(y_ix_i-\bar{y}x_i-\bar{x}(y_i-\bar{y}-\left( \bar{x}x_i+x_i^2-x_i\bar{x}+\bar{x}^2\right) \hat{\beta_1}\right) $

$\displaystyle = \sum_{i=0}^n\left((y_i-\bar{y})(x_i-\bar{x})-( x_i-\bar{x})^2\hat{\beta_1} \right)$

2、公式(3.7)的由来。

公式(3.7)反应了样本均值与总体(Population)  均值之间的偏离程度。假设总体的均值为$\mu$,方差为$\sigma^2$,$\mu_1,\mu_2,\ldots,\mu_n$是从总体中抽取的$n$个样本。样本均值$\bar{\mu}=\frac{1}{n}\sum_{i=1}^n\mu_i$,则有:

$var(\bar{\mu})=E(\bar{\mu}-E(\bar{\mu}))=E\left(\frac{1}{n}\sum_{i=1}^n(\mu_i-\mu)\right)=\frac{\sigma^2}{n}$

这个公式需要用到这样的事实:各个样本之间是独立的随机变量,比如$x_1,x_2$是独立同分布的随机变量,其对应的分布的期望和方差分别为$\mu$和$\sigma^2$,则:

$E\left(x_1+x_2-E(x_1+x_2)\right)^2=E\left(x_1+x_2-2\mu\right)^2=E(x_1^2)+E(x_2^2)+2E(x_1x_2)-4\mu E(x_1)-4\mu E(x_2)+4\mu^2)$

$=E(x_1^2)+E(x_2^2)-2\mu^2=2\sigma^2$

注意,由于前面已经假设$x_1,x_2$是独立的,则$E(x_1x_2)=E(x_1)E(x_2)$。

3、公式(3.8)的推导

可用方差(或标准差的平方)来度量某次参数估计与参数的均值之间差多远(见公式(3.7))。在对参数$\hat{\beta_1}$的估计中,随机变量是$y_i=f(x_i)+\epsilon_i$,其中$var(\epsilon_i)=\sigma^2$,因此有$var\left(y_i-\bar{y}\right)=\sigma^2$(注意,这里的$\bar{y}$是由多个$y_i$相加而得到,可看成是一个常量,实际上它会接近于$\epsilon_i$对应的分布的均值)。 这里假定$\epsilon_i$是对同一分布采样得到,而且这些采样是独立的(见原版书Pxx也是这样规定的),则

$\displaystyle \sum_{i=1}^n var\left((x_i-\bar{x})(y_i-\bar{y})\right)=n\sigma^2\left(\sum_{i=1}^n(x_i-\bar{x})^2\right)$

这个等式成立是利用了这样的定理:若随机变量$\xi_1$与$\xi_2$互不相关,则$var(\xi_1+\xi_2)=var(\xi_1)+var(\xi_2)$。

因此,有

$SE\left(\hat{\beta_1}\right)^2=SE\left(\frac{\sum_{i=1}^n\left((x_i-\bar{x})(y_i-\bar{y})\right)}{\sum_i^n(x_i-\bar{x})}\right)^2=\frac{n\sigma^2\left(\sum_{i=1}^n(x_i-\bar{x})^2\right)}{n\left(\sum_{i=1}^n(x_i-\bar{x})^4\right)}=\frac{\sigma^2}{\left(\sum_{i=1}^n(x_i-\bar{x})^2\right)}$

注意,上面这个等式中的$(x_i-\bar{x}$不是随机变量。

同理可得$SE(\hat{\beta_0})^2=\sigma^2\left[\frac{1}{n}-\frac{\bar{x}^2}{\left(\sum_{i=1}^n(x_i-\bar{x})^2\right)}\right]$

4、公式(3.23)的说明。

公式(3.23)的分子是一个自由度为p的卡方分布(chi squred distribution);而分每是一个自由度为(n-p-1)的卡方分布,因此它们相除就是F分布,即F(p,n-p-1)。

The Elements of Statistical Learning第3章导读的更多相关文章

  1. More 3D Graphics (rgl) for Classification with Local Logistic Regression and Kernel Density Estimates (from The Elements of Statistical Learning)(转)

    This post builds on a previous post, but can be read and understood independently. As part of my cou ...

  2. Some 3D Graphics (rgl) for Classification with Splines and Logistic Regression (from The Elements of Statistical Learning)(转)

    This semester I'm teaching from Hastie, Tibshirani, and Friedman's book, The Elements of Statistical ...

  3. ≪统计学习精要(The Elements of Statistical Learning)≫课堂笔记(三)

    照例文章第一段跑题,先附上个段子(转载的哦~): I hate CS people. They don't know linear algebra but want to teach projecti ...

  4. Hand on Machine Learning第三章课后作业(1):垃圾邮件分类

    import os import email import email.policy 1. 读取邮件数据 SPAM_PATH = os.path.join( "E:\\3.Study\\机器 ...

  5. 《Deep Learning》第二章 线性代数 笔记

    第二章 线性代数 2.1 名词 标量(scalar).向量(vector).矩阵(matrix).张量(tensor) 2.2 矩阵和向量相乘 1. 正常矩阵乘法: 2. 向量点积: 3. Hadam ...

  6. 斯坦福公开课:Statistical Learning中做错的选择题

    4.4 R1 In which of the following problems is Case/Control Sampling LEAST likely to make a positive i ...

  7. Learning Perl 第九章习题第二题

    把输入文件中的所有Fred换成Larry, 不区分大小写. 知识点 1. 文本文件读写 2. 简单的正则替换 3. unless 的用法 4. $_ 的用法

  8. Introduction to statistical learning:with Applications in R (书,数据,R代码,链接)

    http://faculty.marshall.usc.edu/gareth-james/ http://faculty.marshall.usc.edu/gareth-james/ISL/

  9. Hand on Machine Learning 第三章:分类器

    1. 获取数据 使用MNIST数据集练习分类任务 from sklearn.datasets import fetch_mldata from scipy.io import loadmat mnis ...

随机推荐

  1. IndentationError: unexpected indent python

    都知道python是对格式要求很严格的,写了一些python但是也没发现他严格在哪里,今天遇到了IndentationError: unexpected indent错误我才知道他是多么的严格. 以后 ...

  2. html input密码显示为“*”

    1. 功能需求:HTML中,在input password输入框中输入字符将默认显示为“实体圆点”,但这里要求将实体圆点字符替换成“*”号显示. 2. 局限:鼠标光标非IE浏览器不一定显示,选择多个字 ...

  3. string转化为int方法

    int intA = 0; 1.intA =int.Parse(str); 2.int.TryParse(str, out intA); 3.intA = Convert.ToInt32(str);以 ...

  4. 客户调查(client)

    客户调查(client) 题目描述 公司派你去和几位客户面谈,以了解他们对公司产品的意见.你逐个打电话与客户联系,得知他们一般都很忙,不过他们还是可以为你抽出一点时间.现在的问题是有些客户的时间有冲突 ...

  5. GridView的RowCreated与RowDataBound事件区别

    在西门子面试时,项目负责人除了道试题关于RowCreated与RowDataBound事件区别,经过google一下,得出结果: GridView的RowCreated与RowDataBound的一个 ...

  6. Repeater嵌套gridview

    前台:<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSour ...

  7. Win7+QTP10.0+IE9无法识别对象的解决方法

    在WIN7和IE9环境下使用QTP10,会出现识别不了web对象的情况,具体表现为:添加对象,先打开对象库,再打开IE,点击Add object to local 后,出现白色手指,将其拖拉到百度首页 ...

  8. Qt5:随窗口大小变化背景图片自动缩放的实现

    在窗口程序中,当我们改变窗口大小的时候,背景图片通常会岁窗口大小变化而缩放 然而,在我们写的窗口程序中,设置背景图片后,如果缩放大小,会看到背景图片并不会随之缩放, 应为这需要特殊处理,一般常用的方法 ...

  9. 那些学些网址_jquery初学知识

    http://www.cnblogs.com/mingmingruyuedlut/archive/2011/10/18/2216553.html(ajax)http://www.enet.com.cn ...

  10. python数组查找算法---bisect二分查找插入

    1 实例 这个模块只有几个函数, 一旦决定使用二分搜索时,立马要想到使用这个模块 [python] view plaincopyprint? import bisect L = [1,3,3,6,8, ...