-
Notifications
You must be signed in to change notification settings - Fork 23
/
mc4_17.tex
974 lines (642 loc) · 26 KB
/
mc4_17.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
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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
\documentclass{beamer}
%\usepackage[table]{xcolor}
\mode<presentation> {
\usetheme{Boadilla}
% \usetheme{Pittsburgh}
%\usefonttheme[2]{sans}
\renewcommand{\familydefault}{cmss}
%\usepackage{lmodern}
%\usepackage[T1]{fontenc}
%\usepackage{palatino}
%\usepackage{cmbright}
\setbeamercovered{transparent}
\useinnertheme{rectangles}
}
%\usepackage{normalem}{ulem}
%\usepackage{colortbl, textcomp}
\setbeamercolor{normal text}{fg=black}
\setbeamercolor{structure}{fg= black}
\definecolor{trial}{cmyk}{1,0,0, 0}
\definecolor{trial2}{cmyk}{0.00,0,1, 0}
\definecolor{darkgreen}{rgb}{0,.4, 0.1}
\usepackage{array}
\beamertemplatesolidbackgroundcolor{white} \setbeamercolor{alerted
text}{fg=red}
\setbeamertemplate{caption}[numbered]\newcounter{mylastframe}
%\usepackage{color}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{colortbl}
%\usepackage[usenames, dvipsnames]{color}
%\setbeamertemplate{caption}[numbered]\newcounter{mylastframe}c
%\newcolumntype{Y}{\columncolor[cmyk]{0, 0, 1, 0}\raggedright}
%\newcolumntype{C}{\columncolor[cmyk]{1, 0, 0, 0}\raggedright}
%\newcolumntype{G}{\columncolor[rgb]{0, 1, 0}\raggedright}
%\newcolumntype{R}{\columncolor[rgb]{1, 0, 0}\raggedright}
%\begin{beamerboxesrounded}[upper=uppercol,lower=lowercol,shadow=true]{Block}
%$A = B$.
%\end{beamerboxesrounded}}
\renewcommand{\familydefault}{cmss}
%\usepackage[all]{xy}
\usepackage{tikz}
\usepackage{lipsum}
\newenvironment{changemargin}[3]{%
\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{#1}%
\setlength{\rightmargin}{#2}%
\setlength{\topmargin}{#3}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{\parskip}%
}%
\item[]}{\end{list}}
\usetikzlibrary{arrows}
%\usepackage{palatino}
%\usepackage{eulervm}
\usecolortheme{lily}
\newtheorem{com}{Comment}
\newtheorem{lem} {Lemma}
\newtheorem{prop}{Proposition}
\newtheorem{thm}{Theorem}
\newtheorem{defn}{Definition}
\newtheorem{cor}{Corollary}
\newtheorem{obs}{Observation}
\numberwithin{equation}{section}
\title[Methodology I] % (optional, nur bei langen Titeln nötig)
{Math Camp}
\author{Justin Grimmer}
\institute[University of Chicago]{Associate Professor\\Department of Political Science \\ University of Chicago}
\vspace{0.3in}
\date{August 31st, 2017}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\frametitle{Integration}
\begin{itemize}
\item[-] \alert{Derivatives} $\leadsto$ rates of change
\item[-] \alert{Integrals}$\leadsto$ area under a curve
\item[-] \alert{Connection}: fundamental theorem of calculus
\item[-] Some \alert{antiderivative} formulas
\item[-] Algebra of Integrals
\item[-] Improper Integrals
\item[-] Monte Carlo principle
\item[-] \alert{Integrate a lot in probability theory}, we'll review more then
\item[-] Infinite Series
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Area Under a Curve}
\begin{columns}[]
\column{0.6\textwidth}
\only<1>{\scalebox{0.5}{\includegraphics{Log1.pdf}}}
\only<2>{\scalebox{0.5}{\includegraphics{Log2.pdf}}}
\only<3>{\scalebox{0.5}{\includegraphics{Log3.pdf}}}
\only<4>{\scalebox{0.5}{\includegraphics{Log4.pdf}}}
\only<5>{\scalebox{0.5}{\includegraphics{Log5.pdf}}}
\only<6>{\scalebox{0.5}{\includegraphics{Log6.pdf}}}
\column{0.4\textwidth}
\begin{itemize}
\invisible<1>{\item[-]Approximated area $ = \sum_{i=1}^{n} f(x_{i-1}) (x_{i} - x_{i-1} )$ }
\invisible<1-2>{\item[-] As partitions become more refined, they improve}
\invisible<1-5>{\item[-] $\lim_{n\rightarrow \infty} \sum_{i=1}^{n} f(x_{i-1}) (x_{i} - x_{i-1} ) \leadsto$ \alert{Riemann Integral}}
\end{itemize}
\end{columns}
\end{frame}
\begin{frame}
\begin{defn} Suppose $f:\Re \rightarrow \Re$. We will define the Riemann Integral as $\int_{a}^{b} f(x) dx$. If this exists then we say $f$ is \alert{integrable} on $[a,b]$ and call $\int_{a}^{b} f(x) dx$ the \alert{integral} of f.
\end{defn}
\pause
\invisible<1>{\begin{thm}
Suppose $f:[a,b] \rightarrow \Re$ is a continuous function. Then $f$ is integrable
\end{thm}}
\pause
\invisible<1-2>{\begin{thm}
Suppose $f:[a,b]\rightarrow \Re$ is a monotonic function. Then $f$ is integrable
\end{thm}}
\end{frame}
\begin{frame}
\frametitle{Some Counterexamples}
Suppose $f:[0,1]\rightarrow \frac{1}{x}$
\begin{eqnarray}
\int_{0}^{1} \frac{1}{x} dx \nonumber
\end{eqnarray} \pause
\invisible<1>{Then $\frac{1}{x}$ is not integrable on $[a,b]$ because the area that the integral would represent is infinite. \pause \\}
\invisible<1-2>{\begin{eqnarray}
f(x) & = & 1 \text{ if $x$ rational} \nonumber \\
& = & 0 \text{ if $x$ irrational} \nonumber
\end{eqnarray}}\pause
\invisible<1-3>{Not integrable, because every interval will contain a discontinuous jump }
\end{frame}
\begin{frame}
\frametitle{Fundamental Theorem of Calculus}
\pause
\invisible<1>{A \alert{deep} connection between derivatives and integrals makes integration much easier } \pause
\invisible<1-2>{\begin{thm}
\alert{Fundamental Theorem of Calculus} Suppose $f:[a,b] \rightarrow \Re$ and that $f$ is differentiable on $[a,b]$ and that its derivative, $f^{'}$, is integrable. Then,
\begin{eqnarray}
\int_{a}^{b} f^{'} (x) dx & = & f(b) - f(a) \nonumber
\end{eqnarray}
\end{thm}}
\end{frame}
\begin{frame}
\frametitle{Recipe for Definite Integration}
\begin{eqnarray}
\int_{a}^{b} f^{'} (x) dx & = & f(b) - f(a) \nonumber
\end{eqnarray}
\begin{itemize}
\item[-] Calculate \alert{antiderivative}
\item[-] Evaluate at $b$
\item[-] Evaluate at $a$
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Some Classic Antiderivative Formulas}
\alert{antiderivative} = \alert{indefinite integral}
\begin{eqnarray}
\int 1 dx & = & x + c \nonumber \\
\int k dx & = & k x + c \nonumber \\
\int x^{n} dx & = & \frac{x^{n+1}}{n + 1} + c \nonumber \\
\int \frac{1}{x} dx & = & \log x + c \nonumber \\
\int e^{x} dx & = & e^{x} + c \nonumber \\
\int a^{x} dx & = & \frac{a^{x} } {\log a } + c \nonumber
\end{eqnarray}
\end{frame}
\begin{frame}
\frametitle{\alert{Uniform} Distribution}
Suppose $f:\Re \rightarrow \Re$, with
\begin{eqnarray}
f(x) & =& 1 \text{ if } x \in [0,1] \nonumber \\
f(x) & = & 0 \text{ otherwise } \nonumber
\end{eqnarray}
\pause
\invisible<1>{What is the area under $f(x)$ from $[0, 1/2]$? } \pause \\
\begin{eqnarray}
\invisible<1-2>{\int_{0}^{1/2} f(x)dx & = & \int_{0}^{1/2} 1 dx \nonumber } \pause \\
\invisible<1-3>{ & = & x|_{0}^{1/2} \nonumber } \pause \\
\invisible<1-4>{ & = & (1/2) - (0 ) \nonumber \\
& = & 1/2 \nonumber }
\end{eqnarray}
\pause
\invisible<1-5>{We will call $f(x) = 1$ the \alert{uniform distribution}. }
\end{frame}
\begin{frame}
\frametitle{Example 2: Area Under a Line}
Suppose $f:\Re \rightarrow \Re$, with
\begin{eqnarray}
f(x) & = & x \nonumber
\end{eqnarray}
\pause
\invisible<1>{Evaluate the $\int_{2}^{t}f(x)dx$ } \pause
\begin{eqnarray}
\invisible<1-2>{\int_{2}^{t}f(x)dx & = & \int_{2}^{t} x dx \nonumber } \pause \\
\invisible<1-3>{ & = & \frac{x^{2} }{2} |_{2}^{t} \nonumber } \pause \\
\invisible<1-4>{ & = & \frac{t^2}{2} - \frac{2^2}{2} \nonumber } \pause \\
\invisible<1-5>{ & = & \frac{t^2}{2} - \frac{4}{2} = \frac{t^2}{2} - 2 \nonumber }
\end{eqnarray}
\end{frame}
\begin{frame}
\frametitle{Integration Facts}
\begin{thm} If $f_{1}, f_{2}: [a,b] \rightarrow \Re$ and $f_{1}, f_{2} $ are integrable on [a,b], then
\begin{itemize}
\item[i)] Consider the interval $[a,b]$ and $c \in [a,b]$. Then,
\begin{eqnarray}
\int_{c}^{c}f^{'}_{1}(x) dx & = & f_{1}(c) - f_{1}(c) = 0 \nonumber \\
\int_{a}^{b} f^{'}_{1} (x) dx & = & \int_{a}^{c} f^{'}_{1} (x) dx + \int_{c}^{b} f^{'}_{1}(x)dx \nonumber \\
& = & (f_{1} (c) - f_{1}(a) + (f_{1}(b) - f_{1}(c) ) \nonumber \\
& = & f_{1}(b) - f_{1}(a) \nonumber
\end{eqnarray}
\end{itemize}
\end{thm}
\end{frame}
\begin{frame}
\begin{thm} If $f_{1}^{'}, f_{2}^{'}: [a,b] \rightarrow \Re$ and $f_{1}^{'}, f_{2}^{'} $ are integrable on [a,b] and $f_1^{'}$ has antiderivative is $f_1$ and $f_2^{'}$ has antiderivative $f_2$, then
\begin{itemize}
\item[ii)] For $c_{1}, c_{2} \in \Re$ then
\begin{eqnarray}
\int_{a}^{b} (c_{1} f_{1}^{'}(x) + c_{2} f_{2}^{'}(x) ) dx & = & c_{1} \int_{a}^{b} f_{1}^{'}(x)dx + c_{2} \int_{a}^{b}f_{2}^{'}(x) dx \nonumber
\end{eqnarray}
\end{itemize}
\end{thm}
\end{frame}
\begin{frame}
\frametitle{Challenge Problems}
\begin{eqnarray}
& & \int_{0}^{1} xdx \nonumber \\
& & \int_{0}^{1}(x^{2} + x + 1)dx \nonumber \\
& & \int_{1}^{2}(\frac{1}{x} + e^{x} ) \nonumber
\end{eqnarray}
\end{frame}
\begin{frame}
\frametitle{Let's Prove Taylor Theorem (And Come Up With Intuition Too!)}
\begin{thm}
\textbf{Taylor's Theorem}
Suppose $f:\Re \rightarrow \Re$, $f(x)$ is infinitely differentiable function. Then, the taylor expansion of $f(x)$ around \alert{$a$} is given by
\begin{eqnarray}
f(x) & = & f(a) + \frac{f^{'}(a)}{1!} (x- a) + \frac{f^{''}(a)}{2!} (x - a)^2 + \frac{f^{'''}(a)}{3!}(x- a)^3 + \hdots \nonumber \\
f(x) & = & \sum_{n=0}^{\infty } \frac{f^{n} (a) }{n!} (x - a)^n \nonumber
\end{eqnarray}
\end{thm}
\end{frame}
\begin{frame}
Zero Order Approximation
\small
\begin{eqnarray}
f(x) & = & f(a) + \int_{a}^{x} f^{'}(t_{1})dt_{1} \nonumber \pause \\
\invisible<1>{\int_{a}^{x} f^{'}(t_{1})dt_{1} & = & f(x) - f(a) \nonumber \\} \pause
\invisible<1-2>{f(a) + f(x) - f(a) = f(x) \nonumber} \pause
\end{eqnarray}
First order approximation:
\begin{eqnarray}
\invisible<1-3>{f(x) & = & f(a) + \int_{a}^{x} f^{'}(a) dt_{1} + \int_{a}^{x} \int_{a}^{t_{1}} f^{''}(t_{2} ) dt_{2} dt_{1}} \pause \nonumber \\
\invisible<1-4>{\int_{a}^{x} f^{'}(a) dt_{1} & = & f^{'}(a) (x - a) }\nonumber \pause \\
\invisible<1-5>{\int_{a}^{x} \int_{a}^{t_{1}} f^{''}(t_{2} ) dt_{2} dt_{1} & = & \int_{a}^{x} \left(f^{'}(t_{1}) - f^{'}(a) \right)dt_{1}} \nonumber \\
\invisible<1-5>{& = & f(x) - f(a) - f^{'}(a)(x- a)} \nonumber \\ \pause
\invisible<1-6>{& = & f(a) + f^{'}(x- a) + f(x) - f(a) - f^{'}(a)(x- a) \nonumber } \pause \\
\invisible<1-7>{& = & f(x) } \pause \nonumber
\end{eqnarray}
\end{frame}
\begin{frame}
Next step: \pause
\begin{small}
\begin{eqnarray}
f(x) & = & f(a) + \int_{a}^{x} f^{'}(a) dt_{1} + \int_{a}^{x}\int_{a}^{t_{1}} f^{''}(a) dt_{2} dt_{1} + \int_{a}^{x} \int_{a}^{t_{1}}\int_{a}^{t_{2}} f^{'''}(t_{3})dt_{3} t_{2} t_{1} \nonumber
\end{eqnarray}
\end{small}
\pause
\begin{itemize}
\invisible<1>{\item[1)] We have shown this is true for first derivative $k = 1$.} \pause
\invisible<1-2>{\item[2)] Suppose it is true for $k$. Let's show it is true for $k+1$. } \pause
\end{itemize}
\begin{eqnarray}
\invisible<1-3>{f(x) & = & P_{k + 1} + R_{k + 1} \nonumber \\} \pause
\invisible<1-4>{f(x) & = & P_{k} + \nonumber \\} \pause
\invisible<1-5>{&& f^{k+1} (a) \frac{(x - a)^{k+1} }{(k+1)!} + \int_{a}^{x} \int_{a}^{t_{1} } \hdots \int_{a}^{t_{k+1}} f^{k+2} (t_{k+2})dt_{k+2} \hdots dt_{1} \nonumber } \pause
\end{eqnarray}
\invisible<1-6>{Flip bounds on the remainder term and you realize it contains $R_{k}$ and that the additional term cancels out the new $f^{k+1}$ term. \\
Can obtain error bounds with computation of remainder. Because expansion around each point is necessarily finite as $k\rightarrow \infty$ remainder goes to zero. }
\end{frame}
\begin{frame}
\frametitle{More Fundamental Theorem of Calculus}
\begin{thm} Suppose $f^{'}:[a,b] \rightarrow \Re$ is integrable on [a,b] and suppose that its antiderivative is $f(x)$. Define $F(t) = \int_{a}^{t} f^{'} (x) dx$ for $a \leq t \leq b$. Then, $F^{'}(x_{0})$ is $f^{'}(x_{0})$. \end{thm}
\pause
\invisible<1>{\begin{proof} \alert{intuition} $F(t) = \int_{a}^{t} f^{'}(x) dx = f(t) - f(a) $. \\} \pause
\invisible<1-2>{Now, we want to take the derivative of $F(t)$ and evaluate at $x_{0}$ and the derivative of $ f(t) - f(a)$ and evaluate at $x_{0}$} \pause
\begin{eqnarray}
\invisible<1-3>{\frac{\partial}{\partial t} F(t) & = & \frac{\partial}{\partial t} (f(t) - f(a) ) \nonumber \\} \pause
\invisible<1-4>{F^{'}(t) |_{x_{0}} & =& f^{'}(t) |_{x_{0}} \nonumber } \pause \\
\invisible<1-5>{F^{'}(x_{0}) & = & f^{'}(x_{0}) \nonumber}
\end{eqnarray}
\end{proof}
\end{frame}
\begin{frame}
\frametitle{Uniform Cumulative Density Function}
Suppose that $f^{'}\rightarrow \Re$, $f^{'}(x) = 1$ for $x \in [0,1]$ and $f^{'}(x) = 0$ otherwise. Define,
\begin{eqnarray}
F(t) & = & \int_{0}^{t} f^{'}(x) dx \nonumber \\
& = & \int_{0}^{t} 1 dx = x |_{0}^{t} \nonumber \\
& = & t \nonumber
\end{eqnarray}
\begin{center}
\scalebox{0.3}{\includegraphics{uniform1.pdf}}
\scalebox{0.3}{\includegraphics{cdfuniform.pdf}}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Improper Integrals}
Discount rates: valuing the future.\\
We'll do discrete time with infinite series, we can do them in continuous time with integrals
\begin{eqnarray}
V & = & \int_{0}^{\infty} e^{-\delta t } dt \nonumber
\end{eqnarray}
\begin{itemize}
\item[-] How do we evaluate this integral?
\item[-] \alert{Improper integrals}
\item[-] \alert{Continuous} infinite series
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Definition}
\begin{defn} Consider $f:[a, \infty) \rightarrow \Re$. If the limit
\begin{eqnarray}
\lim_{t \rightarrow \infty} && \int_{a}^{t} f(x) dx \nonumber
\end{eqnarray}
exists then we will say $\int_{a}^{\infty} f(x)dx$ \alert{converges} to $L$. Otherwise, we say it \alert{diverges}. \\
\end{defn}
Also apply definition for
\begin{itemize}
\item[-] $\int_{-\infty}^{a} f(x)dx = \lim_{t\rightarrow -\infty } \int_{t}^{a} f(x)dx $
\item[-] $\int_{-\infty}^{\infty} f(x)dx= \lim_{t\rightarrow -\infty } \lim_{y\rightarrow \infty} \int_{t}^{y} f(x)dx$.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{When do Integrals Converge?}
Example 1\\
$f(x) = 1/x$.
\begin{eqnarray}
\int_{1}^{\infty} \frac{1}{x} dx & = & \lim_{t \rightarrow \infty} \int_{1}^{t} \frac{1}{x} dx\nonumber \\
& = & \lim_{t \rightarrow \infty} (\log x)|_{1}^{t} \nonumber \\
& = & \lim_{t \rightarrow \infty} (\log t) - \lim_{t \rightarrow \infty} (\log 1) \nonumber
\end{eqnarray}
\alert{Does not converge}
\end{frame}
\begin{frame}
\frametitle{When do Integrals Converge?}
Example 2 \\
$f(x) = \frac{1}{x^2} $
\begin{eqnarray}
\int_{1}^{\infty} \frac{1}{x^2} dx & = & \lim_{t \rightarrow \infty} \int_{1}^{t} \frac{1}{x^2} dx \nonumber \\
& = & \lim_{t \rightarrow \infty} - \frac{1}{x} |_{1}^{t} \nonumber \\
& = & \lim_{t \rightarrow \infty} -\frac{1}{t} + \frac{1}{1} \nonumber \\
& = & 0 + 1\nonumber
\end{eqnarray}
\end{frame}
\begin{frame}
\frametitle{Substitution (slides borrowed from math.hmc.edu)}
Sometimes, antidifferentiating is \alert{hard}
\begin{eqnarray}
\int (x^2 -1)^4 2x dx \nonumber
\end{eqnarray}
But we can use substitution to simplify. Suspend disbelief and set:
\begin{eqnarray}
u & = & x^2 - 1\nonumber \\
du & = & 2x dx \nonumber
\end{eqnarray}
Rewriting the original,
\begin{eqnarray}
\int (x^2 -1)^4 (2x dx) & = & u^4 du \nonumber \\
&= & \frac{u^5}{5} + c \nonumber \\
& = & \frac{(x^2 - 1)^5}{5} + c\nonumber
\end{eqnarray}
\end{frame}
\begin{frame}
\frametitle{Substitution Rule (slides borrowed from math.hmc.edu)}
Just chain rule in reverse. We know that the antiderivative of
\begin{eqnarray}
\int f(g(x))g^{'}(x) dx & = & F(g(x)) \nonumber
\end{eqnarray}
So, with substitution rule, we look for ways to set up chain rule
\end{frame}
\begin{frame}
\frametitle{Substitution Rule (slides borrowed from math.hmc.edu)}
\begin{eqnarray}
\int - e^{-x} dx && \nonumber \\
u & = & -x \nonumber \\
du & = & - dx \nonumber \\
\int e^{u} du & = & e^{u} + c \nonumber \\
&= & e^{-x} + c \nonumber
\end{eqnarray}
\end{frame}
\begin{frame}
\frametitle{Substitution Rule (slides borrowed from math.hmc.edu)}
We can also multiply by 1 (creatively) to set up substitution rule
\begin{eqnarray}
\int e^{-2x}dx & = & -\frac{1}{2}\int -2 e^{-2x} dx \nonumber \\
u & = & -2 x \nonumber \\
du & = & -2 dx \nonumber \\
-\frac{1}{2} \int e^{u} du & = & -\frac{1}{2} e^{u} + c \nonumber \\
& = & -\frac{1}{2} e^{-2x} + c \nonumber
\end{eqnarray}
\end{frame}
\begin{frame}
\frametitle{Example: Exponential Distribution}
Suppose $f:[0,\infty) \rightarrow \Re$, with $f(x) = e^{-x}$. Evaluate
\begin{eqnarray}
\int_{0}^{\infty} e^{-x} dx& = & \lim_{t\rightarrow \infty} \int_{0}^{t} e^{-x} dx \nonumber \\
& = & \lim_{t \rightarrow \infty} - e^{-x} |_{0}^{t} \nonumber \\
& = & \lim_{t \rightarrow \infty} - e^{-t} + 1 \nonumber\\
& = & 0 + 1 \nonumber
\end{eqnarray}
We will call $f(x) = e^{-x}$ the \alert{exponential} distribution
\end{frame}
\begin{frame}
\frametitle{Integration by Parts}
Consider:
\begin{eqnarray}
&& \int x \cos(x) d x \nonumber
\end{eqnarray}
That is hard to integrate. \\
Instead we'll use \alert{Integration by parts}
\end{frame}
\begin{frame}
\frametitle{Integration by Parts}
Define:
\begin{eqnarray}
g(x) & = & u(x) v(x) \nonumber
\end{eqnarray}
\pause
\invisible<1>{Let's differentiate $g(x)$} \pause
\begin{eqnarray}
\invisible<1-2>{g^{'}(x) & = & u^{'}(x) v(x) + v^{'}(x) u(x) \nonumber } \pause
\end{eqnarray}
\invisible<1-3>{So, antidifferentiating $g^{'}(x)$ yields} \pause
\begin{eqnarray}
\invisible<1-4>{\int g^{'}(x) dx & = & \int u^{'}(x) v(x) dx + \int u(x) v^{'}(x) dx \nonumber \\} \pause
\invisible<1-5>{u(x) v(x) + c - \int u^{'}(x) v(x) dx & = & \int u(x) v^{'}(x) dx \nonumber \\} \pause
\invisible<1-6>{uv - \int v du & =& \int u dv \nonumber}
\end{eqnarray}
\end{frame}
\begin{frame}
\frametitle{Integration by Parts}
\pause
\begin{eqnarray}
\invisible<1>{&& \int x \cos(x) dx \nonumber \\} \pause
\invisible<1-2>{u & = & x \nonumber \\} \pause
\invisible<1-3>{du & = & 1 \nonumber \\} \pause
\invisible<1-4>{dv & = & \cos(x) \nonumber \\} \pause
\invisible<1-5>{v & = & \sin(x) \nonumber } \pause
\end{eqnarray}
\begin{eqnarray}
\invisible<1-6>{\int x \cos(x) dx & = & x \sin (x) - \int \sin(x) 1 dx \nonumber \\} \pause
\invisible<1-7>{& = & x \sin(x) + \cos(x) \nonumber }
\end{eqnarray}
\end{frame}
\begin{frame}
\frametitle{Integration by Parts}
Challenge:
\begin{eqnarray}
&& \int \exp(x) \cos(x) dx \nonumber \\
&& \int \text{log}(x) dx \nonumber \\
&& \int \text{arctan}(x) dx \nonumber
\end{eqnarray}
\pause
\invisible<1>{{\tt Wolfram Alpha (briefly) }}
\end{frame}
\begin{frame}
\frametitle{Monte Carlo and Integration (via Jackman)}
Suppose that we want to compute some integral $\int_{-\infty}^{\infty} xf(x) dx$, but $f(x)$ is \alert{complicated}. \pause
\begin{eqnarray}
\invisible<1>{f(x) & = & \frac{\exp\left(- \frac{(x- \mu)^2}{2\sigma^2} \right) }{\sqrt{2\pi}}} \nonumber
\end{eqnarray}
\pause
\invisible<1-2>{Suppose we can generate random draws from $f(x)$.} \pause \\
\invisible<1-3>{$d_{1}, d_{2}, d_{3}, ..., d_{T}$, then we can approximate this with:} \pause
\begin{eqnarray}
\invisible<1-4>{\text{Expected Value} & = & \frac{1}{T}\sum_{i =1}^{T} d_{i} \nonumber } \pause
\end{eqnarray}
\invisible<1-5>{as $T \rightarrow \infty$,} \pause \invisible<1-6>{$\text{Expected value} \rightarrow \int_{-\infty}^{\infty} xf(x) dx$}
\end{frame}
\begin{frame}
\only<1>{\scalebox{0.5}{\includegraphics{MonteCarloExample.pdf}}}
\only<2>{\scalebox{0.5}{\includegraphics{MonteCarloExample1.pdf}}}
\only<3>{\scalebox{0.5}{\includegraphics{MonteCarloExample2.pdf}}}
\end{frame}
\begin{frame}
{\tt R code for quantiles!}
{\tt MonteCarlo.R}
\end{frame}
\begin{frame}
\frametitle{Infinite Series}
\begin{itemize}
\item[-] Interactions are often \alert{repeated}
\begin{itemize}
\item[-] \alert{Countries}: Fight now or fight later
\item[-] \alert{Congress}: Caro, LBJ, and the Southern Strategy
\item[-] \alert{FDA}: Do I approve this drug?
\item[-] \alert{Bargain}: Do I make a deal now, or wait?
\end{itemize}
\item[-] General idea :
\begin{itemize}
\item[-] Actions have \alert{continuation value}:
\item[-] Value in the present time
\item[-] Stream of benefits in the future
\end{itemize}
\item[-] \alert{Infinite Series} to model
\end{itemize}
Formal definition $\leadsto$ Heuristics $\leadsto$ example problem (from JF)
\end{frame}
\begin{frame}
\frametitle{Infinite Series}
\begin{defn} An infinite series is a pair $(\left\{a_{n}\right\}_{n=1}^{\infty} , \left\{S_{n}\right\}_{n=1}^{\infty})$ where $\left\{a_{n}\right\}_{n=1}^{\infty}$ is a sequence and $S_{n} = \sum_{k=1}^{n} a_{k}$. \end{defn}
\begin{defn} The infinite series $(\left\{a_{n}\right\}_{n=1}^{\infty} , \left\{S_{n}\right\}_{n=1}^{\infty})$ \alert{converges} if the \alert{sequence} $\left\{S_{n}\right\}_{n=1}^{\infty}$ converges to $S$. We'll write this as,
\begin{eqnarray}
\sum_{n=1}^{\infty} a_{n} &= & S \nonumber
\end{eqnarray}
\end{defn}
\end{frame}
\begin{frame}
\frametitle{Infinite Series}
\begin{itemize}
\item[-] Example 1\pause
\begin{itemize}
\invisible<1>{\item[-] $a_{n} = \left\{0, 1, 0, 1, 0, 1, \hdots, \right\}$} \pause
\invisible<1-2>{\item[-] $S_{n} = \sum_{i=1}^{n} a_{n} = \frac{n}{2}$ as $n \rightarrow \infty$ clearly diverges} \pause
\end{itemize}
\invisible<1-3>{\item[-] Example 2} \pause
\begin{itemize}
\invisible<1-4>{\item[-] $a_{n} = \left\{\frac{1}{n (n + 1) } \right\}_{n=1}^{\infty} $ } \pause
\invisible<1-5>{\item[-] We know that $\frac{1}{k (k+ 1) } = \frac{1}{k} - \frac{1}{k + 1}$} \pause
\invisible<1-6>{\item[-] So, for $n = m$, } \pause
\begin{eqnarray}
\invisible<1-7>{S_{m} & = & \sum_{i=1}^{m} a_{i} \nonumber}\pause \\
\invisible<1-8>{ & = & \frac{1}{1 \times 2} + \frac{1}{2 \times 3} + \hdots + \frac{1}{(m)(m+ 1 ) } \nonumber } \pause \\
\invisible<1-9>{S_{m} & = & \left( \frac{1}{1} - \frac{1}{2} \right) + \left( \frac{1}{2} - \frac{1}{3} \right) + \hdots \left( \frac{1}{m} - \frac{1}{m + 1} \right) \nonumber \\} \pause
\invisible<1-10>{ & = & 1 - \frac{1}{m + 1} \nonumber } \pause
\end{eqnarray}
\invisible<1-11>{So $S_{m}$ converges on $1$. (the \alert{sequence} $S_{m}$ converges, just like we prove other sequence convergence)}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{How Do We Assess Convergence?}
\begin{thm} If $\left\{S_{n}\right\}_{n=1}^{\infty}$ converges then $\left\{a_{n}\right\}_{n=1}^{\infty}$ is converges to zero
\end{thm}
\begin{itemize}
\item[-] \alert{Necessary}!
\item[-] \alert{But not sufficient}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Infinite Series Convergence}
Example 1:
\begin{itemize}
\item[-] $a_{n} = \frac{1}{n}$. $S_{n}$,
\begin{eqnarray}
S_{n} & = & 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \hdots \nonumber
\end{eqnarray}
\end{itemize}
\alert{Does this converge?}
\begin{center}
\scalebox{0.35}{\includegraphics{Series1.pdf}}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Infinite Series Convergence}
Suppose $n = 2^{k}$\pause \\
\small
\begin{eqnarray}
\invisible<1>{S_{n} & = & 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \hdots + \frac{1}{2^{k}} \nonumber } \pause \\
\invisible<1-2>{ & = & 1 + \frac{1}{2} + \left(\frac{1}{3} + \frac{1}{4} \right) + \left(\frac{1}{5} + \frac{1}{6} + \frac{1}{7} + \frac{1}{8} \right) + \hdots + \left(\frac{1}{2^{k-1} + 1} + \hdots + \frac{1}{2^{k}}\right) \nonumber } \pause \\
\invisible<1-3>{ & > & \nonumber 1 + \frac{1}{2} + 2 \left(\frac{1}{4} \right) + 4 \left(\frac{1}{8} \right) + \hdots + 2^{k-1} \left(\frac{1}{2^{k}} \right) = 1 + \frac{k}{2} \nonumber } \pause
\end{eqnarray}
\invisible<1-4>{We know that $1 + \frac{k}{2}$ does not converge. } \pause \\
\invisible<1-5>{And we know that $S_{n}> 1 + \frac{k}{2} \leadsto$ \alert{does not converge} (!!)} \pause
\invisible<1-6>{\begin{thm} $\sum_{k=1}^{\infty} \frac{1}{k^{p}}$ converges \alert{if and only if} $p>1$. \end{thm}}
\end{frame}
\begin{frame}
\frametitle{Geometric Series and Discount Rates}
\begin{defn} A geometric series is an infinite series such that $a_{n} = c r^{n}$ and that $S_{n} = \sum_{k=0}^{n} c r^{k} = c + c r + c r^2 + c r^3 + \hdots c r^n $
\end{defn} \pause
\end{frame}
\begin{frame}
\frametitle{Geometric Series and Discount Rates}
\pause
\invisible<1>{\begin{thm} If $|r|<1$, then the geometric series converges to $\frac{c}{1-r}$. If $|r|>1$, the geometric series diverges
\end{thm}} \pause
\begin{proof}
\small
\begin{eqnarray}
\only<3>{\invisible<1-2>{S_{n} & = & \sum_{k=0}^{n} c r^{k} } } \nonumber \\
\invisible<1-3>{(1-r)S_{n} & = & (1- r) \sum_{k=0}^{n} c r^{k} } \pause \nonumber \\
\invisible<1-4>{(1 - r) \sum_{k=0}^{n} c r^{k} & = & c + c r + c r^2 + \hdots + c r^{n} - \nonumber } \pause \\
\invisible<1-5>{& & (c r + c r^2 + c r^3 + \hdots c r^n + c r ^{n + 1} )\nonumber} \pause \\
\invisible<1-6>{& = & c - c r^{n+1 } \nonumber } \pause \\
\invisible<1-7>{S_{n} & = & c \left(\frac{1 - r^{n+ 1} }{1 - r}\right) \nonumber }
\end{eqnarray}
\end{proof}
\pause
\end{frame}
\begin{frame}
\begin{eqnarray}
S_{n} & = & c \left(\frac{1 - r^{n+ 1} }{1 - r}\right) \nonumber \\
& = & c \left( \frac{1}{1-r}\right) - c\left(\frac{r^{n+1}}{1 - r} \right) \nonumber
\end{eqnarray}
$c\left(\frac{r^{n+1}}{1 - r} \right)$ converges \alert{if and only if} $|r|<1$.
\end{frame}
\begin{frame}
\frametitle{Discount Rates and IR (Fearon, Part 2) }
Suppose states are choosing between \alert{attacking} another country to obtain a short time gain, or \alert{cooperating} for peace
\begin{tabular}{c|c|c}
& C & D \\
\hline
C & 20,20 & 10,25 \\
\hline
D &25,10 & 15,15 \\
\hline
\end{tabular}
\alert{Grim-trigger}: cooperate, until defect. Then defect forever \\
Suppose states \alert{discount} future $\delta \in[0,1]$. \\
\begin{eqnarray}
V(C) & = & 20 + \delta 20 + \delta^2 20 + \delta^3 20 + \hdots \nonumber \\
& = & \frac{20}{1- \delta} \nonumber \\
V(D) & = & 25 + \delta 15 + \delta^2 15 + \delta^3 15 \nonumber \\
& = & 25 + \delta \frac{15}{1- \delta} \nonumber
\end{eqnarray}
\end{frame}
\begin{frame}
\frametitle{When Will States Cooperate? (Fearon, Part 2)}
\begin{eqnarray}
V(C) & >& V(D) \nonumber \\
\frac{20}{1- \delta} & > & 25 + \delta \frac{15}{1- \delta} \nonumber \\
\frac{1}{1- \delta} (20 - \delta 15) & > & 25 \nonumber \\
(20 - \delta 15) & > & 25 (1 - \delta ) \nonumber \\
10\delta & > & 5 \nonumber \\
\delta & > & \frac{1}{2} \nonumber
\end{eqnarray}
\end{frame}
\begin{frame}
Linear Algebra Tuesday!
\end{frame}
\end{document}