Law of Iterated Expectations & Covariance
Law of Iterated Expectations
\(E[Y] = E_X[E[Y |X]].\)
The notation \(E_X[.]\) indicates the expectation over the values of \(X\). Note that \(E[Y|X]\)
is a function of \(X\).
Proof for Law of Iterated Expectations
Proof for discrete random variables:
\(E[E[Y|X]]=\sum\limits_{x} E[Y|X=x]P(X=x)
\\= \sum\limits_{x} \sum\limits_{y} yP(Y=y|X=x)P(X=x)
\\= \sum\limits_{x} \sum\limits_{y} \dfrac{yP(X=x,Y=y)}{P(X=x)}P(X=x)
\\= \sum\limits_{y} \sum\limits_{x} yP(X=x,Y=y)
\\= \sum\limits_{y} yP(Y=y)
\\= E(Y).\)
Proof for continuous random variables:
\(E[E[Y|X]]=\int_{-\infin}^{\infin}(\int_{-\infin}^{\infin}yf_{Y|X}(y|x)dy)f_X(x)dx
\\= \int_{-\infin}^{\infin}(\int_{-\infin}^{\infin}y\dfrac{f(x,y)}{f_X(x)}dy)f_X(x)dx
\\= \int_{-\infin}^{\infin} \int_{-\infin}^{\infin}yf(x,y)dxdy
\\= \int_{-\infin}^{\infin} y \int_{-\infin}^{\infin}f(x,y)dxdy
\\= \int_{-\infin}^{\infin} y f_Y(y)dy
\\= E(Y).\)
The process of the proving includes the concept of conditional expectation, which can be learned from this article.
Covariance
In any bivariate distribution,
\(Cov[X, Y] = Cov_X[X, E[Y| X]] = \int_x(x - E[X]) E[Y| X]f_X(x) dx.\)
(Note that this is the covariance of \(x\) and a function of \(x\).)
Proof for discrete random variables:
\(Cov[X,E[Y|X]] = E[X-E[X]][E[Y|X]-E[E[Y|X]]]
\\=E[X-E[X]][E[Y|X]-E[Y]]
\\=E\{[X-E[X]]E[Y|X]-[X-E[X]]E[Y]\}
\\=E[X-E[X]]E[Y|X]-E[X-E[X]]E[Y]
\\=E[XE[Y|X]-E[X]E[Y|X]]-E[X-E[X]]E[Y]
\\=E[XE[Y|X]]-E[X]E[E[Y|X]]-E[X-E[X]]E[Y]
\\=E[XE[Y|X]]-E[X]E[Y]-E[X-E[X]]E[Y]
\\=E[x\sum\limits_y y P(Y=y|X=x)]-E[X]E[Y]
\\=\sum\limits_x \{x[\sum\limits_y y P(Y=y|X=x)]P(X=x)\}-E[X]E[Y]
\\=\sum\limits_x \{x[\sum\limits_y \dfrac{yP(X=x,Y=y)}{P(X=x)}] P(X=x) \}-E[X]E[Y]
\\=\sum\limits_x \sum\limits_y x y P(X=x,Y=y)-E[X]E[Y]
\\=E[X Y]-E[X]E[Y]
\\=Cov[X,Y].\)
Key Steps: \(E[XE[Y|X]]=E[X Y]\), \(E[E[Y|X]]=E[Y]\).
Proof for continuous random variables:
\(Cov[X,E[Y|X]]=E[XE[Y|X]]-E[X]E[Y]
\\=E[x \int_{-\infin}^{\infin} y f_{Y|X}(y|x)dy]-E[X]E[Y]
\\=E[x \int_{-\infin}^{\infin} y \dfrac{f(x, y)}{f_X(x)}dy]-E[X]E[Y]
\\=\int_{-\infin}^{\infin}[x \int_{-\infin}^{\infin} y \dfrac{f(x, y)}{f_X(x)}dy]f_X(x)dx-E[X]E[Y]
\\=\int_{-\infin}^{\infin} \int_{-\infin}^{\infin} x y f(x, y)dydx-E[X]E[Y]
\\=E[X Y]-E[X]E[Y]
\\=Cov[X,Y].\)
Inference
If random variable \(\epsilon\) is mean independent of random variable \(X\), then \(\epsilon\) and \(X\) are linear irrelevant i.e. \(E[\epsilon|X] = E[\epsilon](=0) \Rightarrow \rho_{\epsilon X}=0\)
Proof
\(E[\epsilon|X] = E[\epsilon](=0), Cov(\epsilon, X)=Cov(E[\epsilon|X],X) = Cov(E[\epsilon],X) = 0 \Rightarrow \rho_{\epsilon X} = 0 .\)
Decomposition of Variance OR Law of Total Variance
In a joint distribution,
\(Var[Y] = Var_X[E[Y| X]] + E_X[Var[Y| X]].\)
Proof for Law of Total Variance
\(Var[E[Y|X]]+E[Var[Y|X]]
\\= E[E[Y|X]-E[Y]]^2+E[E[Y|X]^2-E^2[Y|X]]
\\= E[E^2[Y|X]]-E^2[Y]+E[E[Y^2|X]]-E[E^2[Y|X]]
\\= E[E[Y^2|X]]-E^2[Y]
\\= E[Y^2]-E^2[Y].\)
The proof above uses the law of iterated expectations several times. A deeper and more direct understanding of the Law of Total Variance and whose relation to the K-means cluster and OLS can be found in this article.
Law of Iterated Expectations & Covariance的更多相关文章
- Pattern recognition and machine learning 疑难处汇总
不断更新ing......... p141 para 1. 当一个x对应的t值不止一个时,Gaussian nosie assumption就不合适了.因为Gaussian 是unimodal的,这意 ...
- 齐夫定律, Zipf's law,Zipfian distribution
齐夫定律(英语:Zipf's law,IPA英语发音:/ˈzɪf/)是由哈佛大学的语言学家乔治·金斯利·齐夫(George Kingsley Zipf)于1949年发表的实验定律. 它可以表述为: 在 ...
- Ill-conditioned covariance create
http://www.mathworks.com/matlabcentral/answers/100210-why-do-i-receive-an-error-while-trying-to-gene ...
- Conway's law(康威定律)
Mel Conway 康威在加利福尼亚理工学院获得物理学硕士学位,在凯斯西储大学获得数学博士学位.毕业之后,他参与了很多知名的软件项目,如 Pascal 编辑器.在他的职业生涯中,康威观察到一个现象 ...
- 加州大学伯克利分校Stat2.2x Probability 概率初步学习笔记: Section 3 The law of averages, and expected values
Stat2.2x Probability(概率)课程由加州大学伯克利分校(University of California, Berkeley)于2014年在edX平台讲授. PDF笔记下载(Acad ...
- 墨菲定律-Murphy's Law (转载)
墨菲定律 “墨菲定律”(Murphy's Law)亦称莫非定律.莫非定理.或摩菲定理,是西方世界常用的俚语. “墨菲定律”:事情往往会向你所想到的不好的方向发展,只要有这个可能性.比如你衣袋里有两把钥 ...
- BendFord's law's Chi square test
http://www.siam.org/students/siuro/vol1issue1/S01009.pdf bendford'law e=log10(1+l/n) o=freq of first ...
- Educational Codeforces Round 13 D:Iterated Linear Function(数论)
http://codeforces.com/contest/678/problem/D D. Iterated Linear Function Consider a linear function f ...
- 帕金森定律(Parkinson's Law)
帕金森定律(Parkinson's Law)是官僚主义或官僚主义现象的一种别称, 是由英国历史学家.政治学家西里尔·诺斯古德·帕金森(Cyril Northcote Parkinson)通过长期调查研 ...
随机推荐
- 为什么ArrayList的subList结果不能转换为ArrayList????
subList是List接口中的一个方法,该方法主要返回一个集合中的一段子集,可以理解为截取一个集合中的部分元素,它的返回值也是一个List. 让我们初始化一个例子: import java.util ...
- 【SDOI2013】 项链 题解
Solution 将原问题分为两个问题求解. Part 1 首先求珍珠的种类数. 设\(f_i\)表示满足\(gcd = i\)的本质不同珍珠个数, \(g_i\)表示满足\(gcd\)为\(i\)的 ...
- Condition介绍
Condition Condition是一种多线程通信工具,表示多线程下参与数据竞争的线程的一种状态,主要负责多线程环境下对线程的挂起和唤醒工作. 方法 // ========== 阻塞 ====== ...
- 使用 Windows Core Audio APs 进行 Loopback Recording 并生成 WAV 文件
参考文档 COM Coding Practices Audio File Format Specifications Core Audio APIs Loopback Recording #inclu ...
- java学习之Servlet
0x00前言 Servlet就是一个接口我们需要写一个类然后去实现Servlet,就可以被服务器识别到.request是用来接受客户端传过来的参数,respone是用来响应客户端的页面.我们所用的容器 ...
- NC 使用Nginx实现https的反向代理
summary: [通过Nginx实现NCC的https访问,并解决UClient应用的问题] 1 概述 通过Nginx 安装配置反向代理,实现NC.NCC的https访问. 本文以NCC2005为例 ...
- oracle问题记录
ORA-01034: ORACLE not available [oracle@ilanni ~]$ sqlplus /nolog SQL*Plus: Release 10.2.0.1.0 – Pro ...
- <三>使用类模板实现STL Vector
使用类模板实现STL Vector,点击查看代码 #include <iostream> using namespace std; template<typename T> c ...
- bugku web基础$_GET
让我们通过url传入what的值,让其等于flag 直接构造url就得到flag了
- Duplicate property mapping of xxx found in xx 嵌套异常,重复的属性在映射中发现。
该异常的原意是因为在映射文件中出现了两个一样的属性名: <property name="相同的属性名出现了两次以上" > <property name=" ...