forked from bcaffo/courses
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
267 lines (243 loc) · 8.74 KB
/
index.html
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
264
265
266
267
<!DOCTYPE html>
<html>
<head>
<title>Some basic notation and background</title>
<meta charset="utf-8">
<meta name="description" content="Some basic notation and background">
<meta name="author" content="Brian Caffo, PhD">
<meta name="generator" content="slidify" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" href="../../librariesNew/frameworks/io2012/css/default.css" media="all" >
<link rel="stylesheet" href="../../librariesNew/frameworks/io2012/css/phone.css"
media="only screen and (max-device-width: 480px)" >
<link rel="stylesheet" href="../../librariesNew/frameworks/io2012/css/slidify.css" >
<link rel="stylesheet" href="../../librariesNew/highlighters/highlight.js/css/tomorrow.css" />
<base target="_blank"> <!-- This amazingness opens all links in a new tab. -->
<!-- Grab CDN jQuery, fall back to local if offline -->
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js"></script>
<script>window.jQuery || document.write('<script src="../../librariesNew/widgets/quiz/js/jquery.js"><\/script>')</script>
<script data-main="../../librariesNew/frameworks/io2012/js/slides"
src="../../librariesNew/frameworks/io2012/js/require-1.0.8.min.js">
</script>
</head>
<body style="opacity: 0">
<slides class="layout-widescreen">
<!-- LOGO SLIDE -->
<slide class="title-slide segue nobackground">
<aside class="gdbar">
<img src="../../assetsNew/img/bloomberg_shield.png">
</aside>
<hgroup class="auto-fadein">
<h1>Some basic notation and background</h1>
<h2>Regression</h2>
<p>Brian Caffo, PhD<br/>Johns Hopkins Bloomberg School of Public Health</p>
</hgroup>
<article></article>
</slide>
<!-- SLIDES -->
<slide class="" id="slide-1" style="background:;">
<hgroup>
<h2>Some basic definitions</h2>
</hgroup>
<article data-timings="">
<ul>
<li>In this module, we'll cover some basic definitions and notation used throughout the class.</li>
<li>We will try to minimize the amount of mathematics required for this class.</li>
<li>No calculus is required. </li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-2" style="background:;">
<hgroup>
<h2>Notation for data</h2>
</hgroup>
<article data-timings="">
<ul>
<li>We write \(X_1, X_2, \ldots, X_n\) to describe \(n\) data points.</li>
<li>As an example, consider the data set \(\{1, 2, 5\}\) then
<ul>
<li>\(X_1 = 1\), \(X_2 = 2\), \(X_3 = 5\) and \(n = 3\).</li>
</ul></li>
<li>We often use a different letter than \(X\), such as \(Y_1, \ldots , Y_n\).</li>
<li>We will typically use Greek letters for things we don't know.
Such as, \(\mu\) is a mean that we'd like to estimate.</li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-3" style="background:;">
<hgroup>
<h2>The empirical mean</h2>
</hgroup>
<article data-timings="">
<ul>
<li>Define the empirical mean as
\[
\bar X = \frac{1}{n}\sum_{i=1}^n X_i.
\]</li>
<li>Notice if we subtract the mean from data points, we get data that has mean 0. That is, if we define
\[
\tilde X_i = X_i - \bar X.
\]
The mean of the \(\tilde X_i\) is 0.</li>
<li>This process is called "centering" the random variables.</li>
<li>Recall from the previous lecture that the mean is
the least squares solution for minimizing
\[
\sum_{i=1}^n (X_i - \mu)^2
\]</li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-4" style="background:;">
<hgroup>
<h2>The emprical standard deviation and variance</h2>
</hgroup>
<article data-timings="">
<ul>
<li>Define the empirical variance as
\[
S^2 = \frac{1}{n-1} \sum_{i=1}^n (X_i - \bar X)^2
= \frac{1}{n-1} \left( \sum_{i=1}^n X_i^2 - n \bar X ^ 2 \right)
\]</li>
<li>The empirical standard deviation is defined as
\(S = \sqrt{S^2}\). Notice that the standard deviation has the same units as the data.</li>
<li>The data defined by \(X_i / s\) have empirical standard deviation 1. This is called "scaling" the data.</li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-5" style="background:;">
<hgroup>
<h2>Normalization</h2>
</hgroup>
<article data-timings="">
<ul>
<li>The data defined by
\[
Z_i = \frac{X_i - \bar X}{s}
\]
have empirical mean zero and empirical standard deviation 1. </li>
<li>The process of centering then scaling the data is called "normalizing" the data. </li>
<li>Normalized data are centered at 0 and have units equal to standard deviations of the original data. </li>
<li>Example, a value of 2 from normalized data means that data point
was two standard deviations larger than the mean.</li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-6" style="background:;">
<hgroup>
<h2>The empirical covariance</h2>
</hgroup>
<article data-timings="">
<ul>
<li>Consider now when we have pairs of data, \((X_i, Y_i)\).</li>
<li>Their empirical covariance is
\[
Cov(X, Y) =
\frac{1}{n-1}\sum_{i=1}^n (X_i - \bar X) (Y_i - \bar Y)
= \frac{1}{n-1}\left( \sum_{i=1}^n X_i Y_i - n \bar X \bar Y\right)
\]</li>
<li>The correlation is defined is
\[
Cor(X, Y) = \frac{Cov(X, Y)}{S_x S_y}
\]
where \(S_x\) and \(S_y\) are the estimates of standard deviations
for the \(X\) observations and \(Y\) observations, respectively.</li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-7" style="background:;">
<hgroup>
<h2>Some facts about correlation</h2>
</hgroup>
<article data-timings="">
<ul>
<li>\(Cor(X, Y) = Cor(Y, X)\)</li>
<li>\(-1 \leq Cor(X, Y) \leq 1\)</li>
<li>\(Cor(X,Y) = 1\) and \(Cor(X, Y) = -1\) only when the \(X\) or \(Y\) observations fall perfectly on a positive or negative sloped line, respectively.</li>
<li>\(Cor(X, Y)\) measures the strength of the linear relationship between the \(X\) and \(Y\) data, with stronger relationships as \(Cor(X,Y)\) heads towards -1 or 1.</li>
<li>\(Cor(X, Y) = 0\) implies no linear relationship. </li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="backdrop"></slide>
</slides>
<div class="pagination pagination-small" id='io2012-ptoc' style="display:none;">
<ul>
<li>
<a href="#" target="_self" rel='tooltip'
data-slide=1 title='Some basic definitions'>
1
</a>
</li>
<li>
<a href="#" target="_self" rel='tooltip'
data-slide=2 title='Notation for data'>
2
</a>
</li>
<li>
<a href="#" target="_self" rel='tooltip'
data-slide=3 title='The empirical mean'>
3
</a>
</li>
<li>
<a href="#" target="_self" rel='tooltip'
data-slide=4 title='The emprical standard deviation and variance'>
4
</a>
</li>
<li>
<a href="#" target="_self" rel='tooltip'
data-slide=5 title='Normalization'>
5
</a>
</li>
<li>
<a href="#" target="_self" rel='tooltip'
data-slide=6 title='The empirical covariance'>
6
</a>
</li>
<li>
<a href="#" target="_self" rel='tooltip'
data-slide=7 title='Some facts about correlation'>
7
</a>
</li>
</ul>
</div> <!--[if IE]>
<script
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js">
</script>
<script>CFInstall.check({mode: 'overlay'});</script>
<![endif]-->
</body>
<!-- Load Javascripts for Widgets -->
<!-- MathJax: Fall back to local if CDN offline but local image fonts are not supported (saves >100MB) -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
processEscapes: true
}
});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<!-- <script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script> -->
<script>window.MathJax || document.write('<script type="text/x-mathjax-config">MathJax.Hub.Config({"HTML-CSS":{imageFont:null}});<\/script><script src="../../librariesNew/widgets/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"><\/script>')
</script>
<!-- LOAD HIGHLIGHTER JS FILES -->
<script src="../../librariesNew/highlighters/highlight.js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<!-- DONE LOADING HIGHLIGHTER JS FILES -->
</html>