-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
02.2-general-math.Rmd
330 lines (209 loc) · 9.1 KB
/
02.2-general-math.Rmd
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
## General Math
### Number Sets
| Notation | Denotes | Examples |
|--------------|------------------|---------------------------|
| $\emptyset$ | Empty set | No members |
| $\mathbb{N}$ | Natural numbers | $\{1, 2, ...\}$ |
| $\mathbb{Z}$ | Integers | $\{ ..., -1, 0, 1, ...\}$ |
| $\mathbb{Q}$ | Rational numbers | including fractions |
| $\mathbb{R}$ | Real numbers | |
| $\mathbb{C}$ | Complex numbers | |
### Summation Notation and Series
**Chebyshev's Inequality** Let $X$ be a random variable with mean $\mu$ and standard deviation $\sigma$. Then for any positive number $k$:
$$
P(|X-\mu| < k\sigma) \ge 1 - \frac{1}{k^2}
$$
Chebyshev's Inequality does not require that $X$ be normally distributed
**Geometric sum**
$$
\sum_{k=0}^{n-1} ar^k = a\frac{1-r^n}{1-r}
$$
where $r \neq 1$
**Geometric series**
$$
\sum_{k=0}^\infty ar^k = \frac{a}{1-r}
$$
where $|r| <1$
**Binomial theorem**
$$
(x + y)^n = \sum_{k=0}^n \binom{n}{k} x^{n-k} y^k
$$
where $n \ge 0$
**Binomial series**
$$
\sum_k \binom{\alpha}{k} x^k = (1 +x)^\alpha
$$
$|x| < 1$ if $\alpha \neq n \ge 0$
**Telescoping sum**
When terms of a sum cancel each other out, leaving one term (i.e., it collapses like a telescope), we call it a telescoping sum
$$
\sum_{a \le k < b} \Delta F(k) = F(b) - F(a)
$$
where $a \le b$ and $a, b \in \mathbb{Z}$
**Vandermonde convolution**
$$
\sum_k \binom{r}{k} \binom{s}{n-k} = \binom{r+s}{n}
$$
$n \in \mathbb{Z}$
**Exponential series**
$$
\sum_{k=0}^\infty \frac{x^k}{k!} = e^x
$$
where $x \in \mathbb{C}$
**Taylor series**
$$
\sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k!} (x-a)^k = f(x)
$$
where $|x-a| < R =$ radius of convergence
when $a = 0$, we have
**Maclaurin series expansion for**
$$
e^z = 1 + z + \frac{z^2}{2!} + \frac{z^3}{3!} + ...
$$
**Euler's summation formula**
$$\sum_{a \le k < b} f(k) = \int_a^b f(x) dx + \sum_{k=1}^m\frac{B_k}{k!} f^{(k-1)}(x) |_a^b \\+ (-1)^{m+1} \int^b_a \frac{B_m (x-|x|)}{m!} f^{(m)}(x)dx$$ where $a,b, c \in \mathbb{Z}$ and $a \le b, m \ge 1$
when $m = 1$, we have trapezoidal rule
$$
\sum_{a \le k < b} f(k) \approx \int_a^b f(x) dx - \frac{1}{2} (f(b) - f(a))
$$
### Taylor Expansion
A differentiable function, $G(x)$ can be written as an infinite sum of its derivatives.
More specifically, an infinitely differentiable $G(x)$ evaluated at $a$ is
$$
G(x) = G(a) + \frac{G'(a)}{1!} (x-a) + \frac{G''(a)}{2!}(x-a) + \frac{G'''(a)}{3!}(x-a)^3 + \dots
$$
### Law of large numbers
Let $X_1,X_2,...$ be an infinite sequence of independent and identically distributed (i.i.d)
Then, the sample average is
$$
\bar{X}_n =\frac{1}{n} (X_1 + ... + X_n)
$$
converges to the expected value ($\bar{X}_n \rightarrow \mu$) as $n \rightarrow \infty$
$$
Var(X_i) = Var(\frac{1}{n}(X_1 + ... + X_n)) = \frac{1}{n^2}Var(X_1 + ... + X_n)= \frac{n\sigma^2}{n^2}=\frac{\sigma^2}{n}
$$
Note: The connection between the LLN and the normal distribution lies in the [Central Limit Theorem]. The CLT states that, regardless of the original distribution of a dataset, the distribution of the sample means will tend to follow a normal distribution as the sample size becomes larger.
The difference between [Weak Law] and [Strong Law] regards the mode of convergence
#### Weak Law
The sample average converges in probability towards the expected value
$$
\bar{X}_n \rightarrow^{p} \mu
$$
when $n \rightarrow \infty$
$$
\lim_{n\to \infty}P(|\bar{X}_n - \mu| > \epsilon) = 0
$$
The sample mean of an iid random sample ($\{ x_i \}_{i=1}^n$) from any population with a finite mean and finite variance $\sigma^2$ iis a consistent estimator of the population mean $\mu$
$$
plim(\bar{x})=plim(n^{-1}\sum_{i=1}^{n}x_i) =\mu
$$
#### Strong Law
The sample average converges almost surely to the expected value
$$
\bar{X}_n \rightarrow^{a.s} \mu
$$
when $n \rightarrow \infty$
Equivalently,
$$
P(\lim_{n\to \infty}\bar{X}_n =\mu) =1
$$
### Law of Iterated Expectation
Let $X, Y$ be random variables. Then,
$$
E(X) = E(E(X|Y))
$$
means that the expected value of X can be calculated from the probability distribution of $X|Y$ and $Y$
### Convergence
#### Convergence in Probability
- $n \rightarrow \infty$, an estimator (random variable) that is close to the true value.
- The random variable $\theta_n$ converges in probability to a constant $c$ if
$$
\lim_{n\to \infty}P(|\theta_n - c| \ge \epsilon) = 0
$$
for any positive $\epsilon$
Notation
$$
plim(\theta_n)=c
$$
Equivalently,
$$
\theta_n \rightarrow^p c
$$
**Properties of Convergence in Probability**
- Slutsky's Theorem: for a continuous function g(.), if $plim(\theta_n)= \theta$ then $plim(g(\theta_n)) = g(\theta)$
- if $\gamma_n \rightarrow^p \gamma$ then
- $plim(\theta_n + \gamma_n)=\theta + \gamma$ + $plim(\theta_n \gamma_n) = \theta \gamma$ + $plim(\theta_n/\gamma_n) = \theta/\gamma$ if $\gamma \neq 0$
- Also hold for random vectors/ matrices
#### Convergence in Distribution
- As $n \rightarrow \infty$, the distribution of a random variable may converge towards another ("fixed") distribution.
- The random variable $X_n$ with CDF $F_n(x)$ converges in distribution to a random variable $X$ with CDF $F(X)$ if
$$
\lim_{n\to \infty}|F_n(x) - F(x)| = 0
$$
at all points of continuity of $F(X)$
Notation $F(x)$ is the limiting distribution of $X_n$ or $X_n \rightarrow^d X$
- $E(X)$ is the limiting mean (asymptotic mean)
- $Var(X)$ is the limiting variance (asymptotic variance)
**Note**
$$
\begin{aligned}
E(X) &\neq \lim_{n\to \infty}E(X_n) \\
Avar(X_n) &\neq \lim_{n\to \infty}Var(X_n)
\end{aligned}
$$
**Properties of Convergence in Distribution**
- Continuous Mapping Theorem: for a continuous function g(.), if $X_n \to^{d} g(X)$ then $g(X_n) \to^{d} g(X)$
- If $Y_n\to^{d} c$, then
- $X_n + Y_n \to^{d} X + c$
- $Y_nX_n \to^{d} cX$
- $X_nY_n \to^{d} X/c$ if $c \neq 0$
- also hold for random vectors/matrices
#### Summary
Properties of Convergence
| Probability | Distribution |
|-------------------------------------|-----------------------------------|
| Slutsky's Theorem: for a continuous function g(.), if $plim(\theta_n)= \theta$ then $plim(g(\theta_n)) = g(\theta)$ | Continuous Mapping Theorem: for a continuous function g(.), if $X_n \to^{d} g(X)$ then $g(X_n) \to^{d} g(X)$ |
| if $\gamma_n \rightarrow^p \gamma$ then | if $Y_n\to^{d} c$, then |
| $plim(\theta_n + \gamma_n)=\theta + \gamma$ | $X_n + Y_n \to^{d} X + c$ |
| $plim(\theta_n \gamma_n) = \theta \gamma$ | $Y_nX_n \to^{d} cX$ |
| $plim(\theta_n/\gamma_n) = \theta/\gamma$ if $\gamma \neq 0$ | $X_nY_n \to^{d} X/c$ if $c \neq 0$ |
[Convergence in Probability] is stronger than [Convergence in Distribution].
Hence, [Convergence in Distribution] does not guarantee [Convergence in Probability]
### Sufficient Statistics
**Likelihood**
- describes the extent to which the sample provides support for any particular parameter value.
- Higher support corresponds to a higher value for the likelihood
- The exact value of any likelihood is **meaningless**,
- The relative value, (i.e., comparing two values of $\theta$), is **informative**.
$$
L(\theta_0; y) = P(Y = y | \theta = \theta_0) = f_Y(y;\theta_0)
$$
**Likelihood Ratio**
$$
\frac{L(\theta_0;y)}{L(\theta_1;y)}
$$
**Likelihood Function**
For a given sample, you can create likelihoods for all possible values of $\theta$, which is called *likelihood function*
$$
L(\theta) = L(\theta; y) = f_Y(y;\theta)
$$
In a sample of size n, the likelihood function takes the form of a product
$$
L(\theta) = \prod_{i=1}^{n}f_i (y_i;\theta)
$$
Equivalently, the log likelihood function
$$
l(\theta) = \sum_{i=1}^{n} logf_i(y_i;\theta)
$$
**Sufficient statistics**
- A statistic, $T(y)$, is any quantity that can be calculated purely from a sample (independent of $\theta$)
- A statistic is **sufficient** if it conveys all the available information about the parameter.
$$
L(\theta; y) = c(y)L^*(\theta;T(y))
$$
**Nuisance parameters** If we are interested in a parameter (e.g., mean). Other parameters requiring estimation (e.g., standard deviation) are **nuisance** parameters. We can replace nuisance parameters in likelihood function with their estimates to create a **profile likelihood**.
### Parameter transformations
log-odds transformation
$$
Log odds = g(\theta)= ln[\frac{\theta}{1-\theta}]
$$