-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathChap2.tex
263 lines (203 loc) · 6.2 KB
/
Chap2.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
\documentclass[12pt,letterpaper,reqno]{amsart}
\setlength{\oddsidemargin}{.0in}
\setlength{\evensidemargin}{.0in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-.3in}
\setlength{\headsep}{.20in}
\setlength{\textheight}{9.in}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[all]{xy}
\usepackage{graphicx}
\usepackage{setspace}
\doublespace
%Here are some user-defined notations
\newcommand{\E}{\mathbb E}
\newcommand{\R}{\mathbb R}
%improving spacing in tables (space above and below characters in a row)
\newcommand{\tfix}{\rule{0pt}{2.6ex}}
\newcommand{\bfix}{\rule[-1.2ex]{0pt}{0pt}}
%Here are commands with variable inputs
\newcommand{\intf}[1]{\int_a^b{#1}\,dx}
\newcommand{\intfb}[3]{\int_{#1}^{#2}{#3}\,dx}
\newcommand{\pln}[1]{$\sm${\tt #1}}
\newcommand{\bgn}[1]{$\tt {\sm}begin\{#1\}$}
\newcommand{\nd}[1]{$\tt {\sm}end\{#1\}$}
\newcommand{\marginalfootnote}[1]{%
\footnote{#1}
\marginpar[\hfill{\sf\thefootnote}]{{\sf\thefootnote}}}
\newcommand{\edit}[1]{\marginalfootnote{#1}}
\newtheorem*{wellorder*}{Well Ordering Principle}
%These commands deal with theorem-like environments (i.e., italic)
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{conjecture}[theorem]{Conjecture}
%\newtheorem{wellorder}[theorem]{Well Ordering Principle}
%\newtheorem{equation}{Theorem}[section]
%These deal with definition-like environments (i.e., non-italic)
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{remark}[theorem]{Remark}
\theoremstyle{definition}
\newtheorem{Exercise}{Exercise 2.}
\newtheorem{exercise}{exercise 2.}
%This numbers equations by section
\numberwithin{equation}{section}
%\numberwithin{equation}{Theorem}[section]
%This is for hypertext references
\usepackage{color}
\usepackage{hyperref}
\begin{document}
\author{Zhizhong Pu}
\title{Solutions - Chapter 2}
\date{Feb 2023}
\maketitle
\thispagestyle{empty}
%% 2.1
\begin{Exercise} Find $\E[\E[\E[Y|X_1,X_2,X_3]|X_1,X_2]|X_1]$.
Since $\E[\E[Y|X_1,X_2,X_3]|X_1,X_2]=\E[Y|X_1,X_2]$ by LIE, then we have:
\[
\E[\E[\E[Y|X_1,X_2,X_3]|X_1,X_2]|X_1] = \E[\E[Y|X_1,X_2]|X_1] = \E[Y|X_1]
\]
\end{Exercise}
%% 2.2
\begin{Exercise} If $\E[Y|X]=a+bX$, find $\E[YX]$ as a function of moments of $X$.
Since $\E[Y|X]=a+bX$, we follow chapter 2.8 to define CEF error:
\[
e=Y-\E[Y|X]=Y-a+bX\Rightarrow Y=a+bX+e
\]
Then substitute $Y$ into $\E[YX]$:
\[
\E[YX]=\E[(a+bX+e)X]=a\E[X]+b\E[X^2]+\E[eX]
\]
Note that the last term is $0$ by Theorem 2.4.4, then
\[
\E[YX]=\E[(a+bX+e)X]=b\E[X^2]+a\E[X]
\]
\end{Exercise}
%% 2.3
\begin{Exercise}
Prove Theorem 2.4.4 using the law of iterated expectations: for any function $h(x)$ such that $\E|h(X)e|<\infty$ then $\E[h(X)e]=0$
\begin{proof} Wooldridge (2010) CE.6 Proof
Given any function $h()$, we can write
\[
\E[h(X)e]=\E[\E(h(X)e|X)]=\E[h(X)\E(e|X)]=\E[h(X)0]=0
\]
using LIE, take-out-what's-known property, and $\E(e|X)=0$ from Theorem 2.4.1, respectively.
\end{proof}
\end{Exercise}
%% 2.4
\begin{Exercise} See book
By the definition of conditional expectation:
\[
\E[Y|X=0]=\sum_{y\in{0,1}}yP(Y=y|X=0)=1P(Y=1|X=0)=0.8
\]
\[
\E[Y|X=1]=\sum_{y\in{0,1}}yP(Y=y|X=1)=1P(Y=1|X=1)=0.6
\]
(Note that LIE can be verified: $\E[\E[Y|X]]=0.7=\E[Y]$)
By LOTUS:
\[
\E[Y^2|X=0]=\sum_{y\in{0,1}}y^2P(Y=y|X=0)=1P(Y=1|X=0)=0.8 \\
\]
\[
\E[Y^2|X=1]=\sum_{y\in{0,1}}y^2P(Y=y|X=1)=1P(Y=1|X=1)=0.6
\]
By definition of conditional variance:
\[
Var(Y|X=0)=\E[Y^2|X=0]-(\E[Y|X=0])^2=0.8-(0.8)^2=0.16
\]
\[
Var(Y|X=1)=\E[Y^2|X=1]-(\E[Y|X=1])^2=0.6-(0.6)^2=0.24
\]
\end{Exercise}
%% 2.5
\begin{Exercise} Show that $\sigma^2(X)$ is the best predictor of $e^2$ given $X$
\end{Exercise}
%% 2.6
\begin{Exercise} Use $Y=m(X)+e$ to show that $Var(Y)=Var[(m(X)]+\sigma^2$.
*Note on notation: $\sigma^2=\E[e^2]$.
Consider the LHS. By definition of variance:
\[
Var(Y)=Var[m(X)+e]=\E[(m(X)+e)^2]-(\E[m(X)+e])^2
\]
The first term is (using $\E[m(X)e]=0$ from Theorem 2.4.4.):
\[
\E[(m(X)+e)^2]=\E[m^2(X)]+2\E[m(X)e]+\E[e^2]=\E[m^2(X)]+\E[e^2]
\]
The second term is (using 0 unconditional mean of error term):
\[
-(\E[m(X)+e])^2=-(\E[m(X)]+\E[e])^2=-(\E[m(X)]+0)^2=-\E[m(X)]^2
\]
Sum up the two terms:
\[
Var(Y)=\E[(m(X)+e)^2]-(\E[m(X)+e])^2=\E[m^2(X)]+\E[e^2]-\E[m(X)]^2=Var[(m(X)]+\sigma^2
\]
\end{Exercise}
%% 2.7
\begin{Exercise} Show that the conditional variance can be written as $\sigma^2(X)=\E[Y^2|X]-\E[Y|X]^2$
By definition 2.1, we can write
\[\begin{split}
\sigma^2(X) & \equiv Var(Y|X) = \E[(Y-\E(Y|X))^2|X] \\
& = \E[Y^2-2Y\E(Y|X)+\E(Y|X)^2|X] \\
& = \E[Y^2|X] - 2\E[Y\E(Y|X)|X] + \E[\E(Y|X)^2|X]
\end{split}\]
Note that in the last two terms, $\E(Y|X)$ and $\E(Y|X)^2$ are both functions of X, so we can apply take-out-what's-known property:
\[
= \E[Y^2|X] - 2\E(Y|X)\E(Y|X) + \E(Y|X)^2\E[1|X] = \E[Y^2|X] - \E(Y|X)^2
\]
\end{Exercise}
% 2.8
\begin{Exercise}
\end{Exercise}
% 2.9
\begin{Exercise}
\end{Exercise}
% 2.10
\begin{Exercise} True or False. If $Y = X\beta+e$, $X \in \R$, and $\E[e|X] = 0$, then $\E[X^2e]=0$.
True.
\[
\E[X^2e]=\E[\E[X^2e|X]]=\E[X^2\E[e|X]]=\E[0X^2]=0
\]
\end{Exercise}
% 2.11
\begin{Exercise}
\end{Exercise}
% 2.12
\begin{Exercise}
\end{Exercise}
% 2.13
\begin{Exercise}
\end{Exercise}
% 2.14
\begin{Exercise}
\end{Exercise}
% 2.15
\begin{Exercise} Consider the intercept-only model $Y = a + e$ with $a$ the best linear predictor. Show that
$a = \E[Y]$.
We can write MSE as:
\[\begin{split}
\E[e^2] = \E[(Y-a)^2] = \E[Y^2]-2a\E[Y]+a^2
\end{split}\]
Apply the first order condition:
\[
\frac{\partial}{\partial a} \E[e^2] = -2\E[Y]+2a \equiv 0
\]
This shows $a = \E[Y]$.
\end{Exercise}
% 2.16
\begin{Exercise}
I do not recommend this problem for calculations are complicated.
\[
\beta=E(XX')^{-1}(XY)=\frac{\E(XY)}{\E(X^2)}=\frac{7}{16} \cdot \frac{15}{7} = \frac{15}{16}
\]
\[
\E[Y|X]= \int_{0}^{1} y \cdot f_{Y|X}(y|x) \,dy = \int_{0}^{1} y \frac{x^2+y^2}{x^2+\frac{1}{3}} \,dy = \frac{6x^2+3}{12x^2+4}
\]
\end{Exercise}
\end{document}