-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathguide.tex
1879 lines (1502 loc) · 102 KB
/
guide.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
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[titlestyle=hang,11pt]{elegantbook}
\author{Jinxiong \& Zhang}
\email{[email protected]}
%\zhtitle{优美的\LaTeX{} 书籍}
%\zhend{模板}
\entitle{A Guide to Data Science}
%\enend{Template}
\version{3.00}
\myquote{From mathematics to algorithms.}
\logo{logo.png}
\cover{cover.pdf}
%green color
\definecolor{main1}{RGB}{0,120,2}
\definecolor{second1}{RGB}{230,90,7}
\definecolor{third1}{RGB}{0,160,152}
%cyan color
\definecolor{main2}{RGB}{0,175,152}
\definecolor{second2}{RGB}{239,126,30}
\definecolor{third2}{RGB}{120,8,13}
%blue color
\definecolor{main3}{RGB}{20,50,104}
\definecolor{second3}{RGB}{180,50,131}
\definecolor{third3}{RGB}{7,127,128}
\usepackage{makecell}
\usepackage{lipsum}
\usepackage{texnames}
\usepackage{xcolor}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage[colorlinks,linkcolor=blue]{hyperref}
\usepackage{amsmath}
\usepackage{animate}
\usepackage{subfigure}
\begin{document}
\maketitle
\tableofcontents
\mainmatter
\chapter{Abstract}
This is a brief introduction to data science. \href{https://www.wikiwand.com/en/Data_science}{Data science} can be seen as an extension of statistics.
\begin{itemize}
\item $\textcolor{red}{\text{ All sciences are, in the abstract, mathematics.}}$
\item $\textcolor{red}{\text{ All judgments are, in their rationale, statistics. by C.P. Rao}}$
\end{itemize}
\href{http://norvig.com/chomsky.html}{On Chomsky and the Two Cultures of Statistical Learning} or \href{https://projecteuclid.org/euclid.ss/1009213726}{Statistical Modeling: The Two Cultures (with comments and a rejoinder by the author)} provides more discussion of statistical model or data science.
\includegraphics[width = .8\textwidth]{john-von-neumanns-quotes-7.jpg}
\chapter{Statistical Foundation}
"Statistics, in a nutshell, is a discipline that studies the best ways of dealing with randomness, or more precisely and broadly, variation", \href{https://statistics.fas.harvard.edu/about}{Professor Xiao-Li Meng said}.
\begin{table}[h]
\centering
\caption{On mathematical model}
\begin{tabular}{|c|}
\hline
\includegraphics[width = .95\textwidth]{Albert.jpg} \\
\includegraphics[width = .95\textwidth]{model.jpg} \\
%\hline
%\includegraphics[width = .8\textwidth]{john-von-neumanns-quotes-7.jpg}
\end{tabular}
\end{table}
\section{Basic Probability}
Probability theory is regarded as the theoretical foundation of statistics,which provides the ideal models to measure
the stochastic phenomenon, randomness, chance or luck.
It is the distribution theory bridging probability and statistics.
The project \href{https://seeing-theory.brown.edu/#secondPage/chapter5}{Seeing theory} is a brief introduction to statistics and probability theory
and provides a \href{https://seeing-theory.brown.edu/doc/seeing-theory.pdf}{.pdf file}.
\subsection{Random Variable}
\begin{definition}{Random Variable}{r.v.}
A random variable is a mapping
\[ \color{green}{X:\Omega \rightarrow \mathbb{R}} \]
that assigns a real number $X(\omega)$ to each outcome $\omega$.
\begin{itemize}
\item $\Omega$ is the sample space.
\item $\omega$ in $\Omega$ are called sample outcomes or realization.
\item Subsets of $\Omega$ are called $\mathrm{Event}$.
\end{itemize}
\end{definition}
\begin{definition}{Probability}{Pr}
A function $P$ is called probability function with respect to the known sample space $\Omega$ and all the event $\forall \omega \in \Omega$ if
\begin{center}
\begin{tabular}{|l|c|}
\hline
Properties& Conditions\\
\hline
Nonnegative & {$P(\omega) \geq 0 \forall \omega \in \Omega$} \\
\hline
Normalized & $P(\Omega) = 1$ \\
\hline
Additive & \text{If $\omega_1, \omega_2, \cdots \in \Omega$ are disjoint, then $P(\bigcup_{i=1}^{\infty}\omega_i)=\sum_{i=1}^{\infty}P(\omega_i)$} \\
\hline
\end{tabular}
\end{center}
\end{definition}
These properties are called \href{https://en.wikipedia.org/wiki/Probability_axioms}{Kolmogorov axioms}.
\subsection{Discrete Distribution}
Random variable or event is countable or listed, then we can list the probability of every event.
If so, we can compute the probability of a random variable less than the given value. For example, $P(X\leq 10)=\sum_{i=1}^{10}P(X=i)$ if the random variable $X$ only takes positive integers.
\begin{definition}{Probability mass function}{pmf}
The probability mass function of a discrete random variable $X$ is defined as
$$f_X(x)=P_X(X=x)$$
for all $x$.
\end{definition}
The left subindex $\mathrm{X}$ is to point out that the probability is with respect to the random variable $X$ and it can omit if no confusion.
\subsection{Continuous Distribution}
If random variables may take on a continuous range of values, it is hard or valueless to compute the probability of a given value. It is usually to find the cumulative distribution function.
\begin{definition}{Cumulative Distribution Function}{CDF}
A function $F(x)$ is called cumulative distribution function (CDF in short) if
\begin{itemize}
\item $\lim_{x\to -\infty}F(x) = 0$ and $\lim_{x\to \infty}F(x) = 1$ ;
\item The function $F(x)$ is monotone increasing function with $x$;
\item $\lim_{x\to x_0^+ } F(x) = F(x_0)$ for all $x_0$.
\end{itemize}
\end{definition}
In probability, $\forall x$, $F(x) = P(X\leq x)$ for some random variable $X$.
For example, if the random variable $X$ has the cumulative distribution function (CDF)
\[ F_X(x)=\begin{cases} x, & \text{$x \in [0, 1]$}\\1, &\text{$x\in (1, \infty)$}\\0, & \text{otherwise}\end{cases}, \]
we say the random variable $X$ is uniformly distributed in $[0, 1]$.
We can see \href{https://www.encyclopediaofmath.org/index.php/Continuous_distribution}{this link}.
The probability density function can be seen as the counterpart of pmf.
For the continuous random variable $X$, its CDF $F_X(x)$ is not required to be differentiable.
But if so, we can compute the derivative of the CDF $F_X(x)$: $\frac{\mathrm{d}F_X(x)}{\mathrm{d}x} = f_X(x)$.
\begin{definition}{Probability Density Function}{pdf}
We call the function $f_X(x)$ is the probability density function with respect to the continuous random variable $X$ if
\[ F_X(x) = \int_{-\infty}^{x}f_X(t)\mathrm{d}t \]
for all $x$, where $F_X(x)$ is the probability cumulative function of the random variable $X$.
\end{definition}
For example, the random variable $X$ uniformly distributed in $[0, 1]$ has the probability density function
\[ f_X(x)=\begin{cases} 1, & \text{$x \in [0, 1]$}\\0, & \text{otherwise}\end{cases}. \]
If the pdf $f_X$ is positive in the set $\mathbf{S}$, we call the set $\mathbf{S}$ is the support set or support of the distribution.
One common probability - $\color{teal}{\text{normal or Gaussian distribution}}$ - is often given in the pdf:
\[ f(x|\sigma^2, \mu)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}, \]
where $\sigma^2$ is given positive and finite, $\mu$ is given and finite. And its support is $(-\infty,\infty)$.
\begin{center}
\includegraphics[width = 16cm]{Gaussian.jpg}
\end{center}
The density function of a power law distribution is in the form of
\[ f_X(x)= x^{-\alpha}, x\in [1,\infty) \]
where $\alpha$ is real. It is also called \href{https://www.wikiwand.com/en/Pareto_distribution}{Pareto-type distribution}.
The power law can be used to describe a phenomenon where a small number of items is clustered at the top of a distribution (or at the bottom), taking up $95\%$ of the resources. In other words, it implies a small amount of occurrences is common, while larger occurrences are rare.
Every probability distribution is an ideal mathematical model that describes some real event.
Here is [a field guide to continuous distribution](http://threeplusone.com/FieldGuide.pdf).
\subsection{Bivariate Distribution}
The cumulative probability function and probability density function are really functions with some required properties. We wonder the bivariate functions in probability theory.
\begin{definition}{Joint Distribution Function}{j.d.f.}
The joint distribution function $F:\mathbb{R}^{2}\rightarrow [0,1]$, where $X$ and $Y$ are discrete variables, is given by
\[ F_{(X,Y)}(x,y)=P(X\leq x, Y\leq y). \]
\end{definition}
Their joint mass function $f:\mathbb{R}^{2}\rightarrow [0,1]$ is given by
\[ f_{(X,Y)}(x,y)=P(X=x, Y=y). \]
\begin{definition}{Joint Density Function}{J.D.F}
The joint distribution function $F_{(X,Y)}:\mathbb{R}^{2}\rightarrow [0,1]$, where $X$ and > $Y$ are continuous variables, is given by $F_{(X,Y)}(x,y)=P(X\leq x, Y\leq y)$. And their joint density > function if $f_{X,Y}(x, y)$ satisfies that
\[ F_{(X,Y)}(x,y)=\int_{v=-\infty}^{y}\int_{u=-\infty}^{x}f_{(X,Y)}(u,v)\mathrm{d}u\mathrm{d}v \]
for each $x,y \in \mathbb{R}$.
\end{definition}
\begin{definition}{Marginal Distribution}{Marginal Dis}
The marginal distributed of $X$ and $Y$ are
\[ F_X(x)=P(X\leq x)=F_{(X,Y)}(x,\infty)\quad\text{and}\quad F_Y(y)=P(X\leq x)=F_{(X,Y)} (\infty, y) \]
for discrete random variables;
\[ F_X(x)=\int_{-\infty}^{x}(\int_{\mathbb{R}}f_{(X,Y)}(u, y)\mathrm{d}y)\mathrm{d}u \quad\text{and}\quad F_Y(y)=\int_{-\infty}^{y}(\int_{\mathbb{R}}f_{(X,Y)}(x,v)\mathrm{d}v)\mathrm{d}x \]
for continuous random variables and the marginal probability density function is
\[ f_X(x)=\int_{\mathbb{R}}f_{(X,Y)}(x, y)\mathrm{d}y,\quad f_Y(y)=\int_{\mathbb{R}}f_{(X,Y)}(x, y)\mathrm{d}x.\]
\end{definition}
Two random variables $\color{red}{X}$ and $\color{blue}{Y}$ are called as identically distributed if $P(x\in A)=P(y\in A)$ for any $A \subset \mathbb{R}$.
\section{Representation of Random Variable}
The random variable is nearly no sense without its probability distribution. We can choose the CDF or pdf to depict the probability, which depends on the case.
We know that a function of random variable is also a random variable.
For example, supposing that $\color{teal}{X}$ is a random variable, the function $\color{teal}{g(X)= e^{X}}$ is a random variable as well as $\color{teal}{g(X)=\ln(X)}$.
$\color{teal}{\text{The function of random variable must have its distribution}}$.
We can take it to generate more distributions.
\begin{theorem}
Suppose that $X$ is with the cumulative distribution function $\color{red}{\text{CDF}}$ $F_X(x)$ and $Y=F_X(X)$, then $Y$ is $\color{teal}{uniformly}$ distributed in the interval $[0, 1]$.
\end{theorem}
Let $X$ and $Y$ be two different random variables, $Z= X+Y$ or $Z = X\cdot Y$ are typical functions of random variables, especially $X$ is discrete while $Y$ is continuous.
%More on the Wikipedia page [random variable](https://www.wikiwand.com/en/Random_variable)
\subsection{Mixture Representation}
Let $P_1,P_2,\cdots, P_n$ be probability distribution and $\sum_{i=1}^{n}\lambda_i=1,\lambda_i > 0 \quad \forall i\in\{1,2,\cdots,n\}$, we can get
\[ P=\sum_{i=1}^{n}\lambda_iP_i \]
is also a probability distribution.
If $X$ is distributed in $P$, i.e.$X\sim P$, its probability is computed as
\[ P(X=x)=\sum_{i=1}^{n}\lambda_iP_i(X=x) \]
for discrete random variable or
\[ P(X\leq x)=\sum_{i=1}^{n}\lambda_iP_i(X\leq x) \]
for continuous random variable.
A random variable $X$ is said to have a mixture distribution if the distribution of $X$ depends on a quantity that also has a distribution.
Sometimes, it is quite difficult if we directly generate a random vector $X\sim f_X(x)$, but the augmented vector $(X, Z)
^⊤\sim f_{(X,Z)}(x, z)$ is relatively easy to generate such as [Box-Muller algorithm].
And we can represent $f_X(x)$ as the marginal probability distribution of $f_{(X,Y)}(x,y)$ in integral form
\[ \int_{\mathbb{R}}f_{(X,Z)}(x,z) \mathrm{d}z. \]
Thanks to Professor Tian Guoliang(Gary) in SUSTech, who brought me to computational statistics.
More information on probability can be founded in \href{http://probweb.berkeley.edu/probweb.html}{The Probability web}.
\section{Bayes' Theorem}
Bayes theorem is the foundation of Bayesian statistics in honor of the statistician \href{https://en.wikipedia.org/wiki/Thomas_Bayes}{Thomas Bayes}.
\subsection{Conditional Probability}
If the set $A$ is the subset of $B$, i.e. $A\subset B$, we know that if $x\in A$, $x\in B$.
We can say if $A$ happened, the event $B$ must have happened. However, if $B$ happened, what is probability when $A$ happened? It should be larger than the probability of $A$ when $B$ did not happened and it is also larger than the probability of $A$ when the events including $B$ happened. We know that $A\bigcap B=A$ when $A$ is the subset of $B$.
\begin{definition}{Conditional Probability}{Conditional Prob}
Supposing $A, B\in \Omega$ and $P(B) > 0$, the conditional probability of $A$ given $B$(denoted as $P(A|B))$ is
\[ P(A|B)=\frac{P(A\bigcap B)}{P(B)}. \]
\end{definition}
The vertical bar $|$ means that the right one is given or known and is parameter rather than variable.
Here is \href{http://setosa.io/conditional/}{a visual explanation}.
\begin{definition}{Statistical Independence}{Independence}
If $P(A\bigcap B)= P(A)P(B)$, we call the event $A$ and $B$ are statistically independent.
\end{definition}
From the definition of conditional probability, it is obvious that:
\begin{itemize}
\item $P(B)=\frac{P(A\bigcap B)}{P(A|B)}$;
\item $P(A\bigcap B)=P(A|B)P(B)$;
\item $P(A\bigcap B)=P(B|A)P(A)$.
\end{itemize}
Thus
\begin{itemize}
\item $P(A|B)P(B)=P(B|A)P(A)$;
\item $P(A|B)=\frac{P(B|A)P(A)}{P(B)}=P(B|A) \frac{P(A)}{P(B)}$;
\item $P(B)=\frac{P(B|A)P(A)}{P(A|B}=\frac{P(B|A)}{P(A|B)}P(A)$.
\end{itemize}
\begin{definition}{Conditional Distribution Function}{Condintional Distribution Function}
The conditional distribution function of $Y$ given $X=x$ is the function $F_{Y|X}(y|x)$ given by
\[ F_{Y|X}(y|x)=\int_{-\infty}^{x}\frac{f_{(X,Y)}(x,v)}{f_X(x)}\mathrm{d}v=\frac{\int_{-\infty}^{x}f_{(X,Y)}(x,v)\mathrm{d}v}{f_{X}(x)} \]
for the support of $f_X(x)$ and the conditional probability density function of $F_{Y|X}$, written $f_{Y|X}(y|x)$, is given by
\[ f_{Y|X}(y|x)=\frac{f_{(X,Y)}(x,y)}{f_X(x)} \]
for any $x$ such that $f_X(x)>0$.
\end{definition}
\begin{definition}{Conditional Probability for Continuous Random Variable}{Conditional Probability for Continuous Random Variable}
If $X$ and $Y$ are non-generate and jointly continuous random variables with density $f_{X,Y}(x, y)$ then, if $B$ has positive measure,
\[ P(X\in A|Y \in B)=\frac{\int_{y\in B}\int_{x\in \color{red}{A}}f_{X,Y}(x,y)\mathbb{d}x\mathbb{d}y}{\int_{y\in B}\int_{x\in \color{red}{\mathbb{R}}}f_{X,Y}(x,y)\mathbb{d}x\mathbb{d}y}. \]
\end{definition}
\begin{definition}{Chain Rule of Probability}{Chain Rule of Probability}
\[ P(x^{(1)},\cdots, x^{(n)})=P(x^{(1)})\prod_{i=2}^{n}P(x^{i}|x^{(1),\cdots, x^{(i-1)}}) \]
\end{definition}
\begin{definition}{Conditional independence}{Conditional independence}
The event $A$ and $B$ are \href{https://www.wikiwand.com/en/Conditional_independence}{conditionally independent} given $C$ if and only if
\[ P(A\bigcap B|C)=P(A|C)P(B|C).\]
\end{definition}
\begin{theorem}{Total Probability Theorem}{Total Probability Theorem}
Supposing the events $A_1, A_2, \cdots$ are disjoint in the sample space $\Omega$ and $\bigcup_{i=1}^{\infty}A_i = \Omega$, $B$ is any subset of $\Omega$, we have
\[ P(B)=\sum_{i=1}^{\infty}P(B\bigcap A_i)=\sum_{i=1}^{\infty}P(B|A_i)P(A_i). \]
\end{theorem}
\begin{note}
\begin{itemize}
\item For the discrete random variable, the total probability theorem tells that any event can be decomposed to the basic event in the event space.
\item For the continuous random variable, this theorems means that $$\int_{\mathbb{B}}f_X(x)\mathrm{d}x=\sum_{i=1}^{\infty}\int_{\mathbb{B}\bigcap\mathbb{A_i}}f_X(x)\mathbb{d}x.$$
\end{itemize}
\end{note}
\subsection{Bayes's Formula and Inverse Bayes' Formula}
\begin{theorem}{Bayes's Formula}{Bayes's Formula}
Supposing the events $A_1, A_2, \cdots$ are disjoint in the sample space $\Omega$ and $\bigcup_{i=1}^{\infty}A_i = \Omega$, $B$ is any subset of $\Omega$, we have
\[ P(A_i|B)=\frac{P(B|A_i)P(A_i)}{\sum_{i=1}^{\infty}P(B|A_i)P(A_i)}=\frac{P(B|A_i)P(A_i)}{P(B)}. \]
\end{theorem}
\begin{note}
\begin{itemize}
\item The probability $P(A_i)$ is called prior probability of event $A_i$ and the conditional probability $P(A_i|B)$ is called posterior probability of the event $A_i$ in Bayesian statistics.
\item For any $A_i$, $P(A_i|B)\propto\, P(B|A_i)P(A_i)$ and $P(B)$ is the normalization constant as the sum of $P(B|A_i)P(A_i)$.
\end{itemize}
\end{note}
\begin{center}
\includegraphics[width = .8\textwidth]{thomas_bayes.jpg}
\end{center}
The joint pdf of the random variables $X$ and $Y$ can be expressed as
\[ f_{(x,y)}(x,y)=f_{X|Y}(x|y)f_{Y}(y)=f_{Y|X}(y|x)f_{X}(x). \]
in some proper conditions.
Thus we get by division
$$ f_{Y}(y)=\frac{f_{Y|X}(y|x)f_{X}(x)}{f_{X|Y}(x|y)}. \eqno{(1)} $$
Integrating this identity with respect to $y$ on support of $f_{Y}(y)$, we immediately
have the \textbf{point-wise formula} as shown below
$$ f_{X}(x)=\{\int_{f_{X|Y}(x|y)\neq {0}}\frac{f_{Y|X}(y|x)}{f_{X|Y}(x|y)} \mathrm{d}y\}^{-1}.\eqno{(2)} $$
Now substitute (2) into (1), we obtain the dual form of IBF for $f_Y(y)$ and hence by symmetry we obtain the \textbf{function-wise formula} of $f_Y(y)$ at $y_0$ as shown in (f1), or the
sampling formula in (f2) when the normalizing constant is omitted.
\begin{align}
f_{X}(x)
&=\{\int_{f_{Y|X}(y|X)\neq {0}}\frac{f_{X|Y}(x|y_0)}{f_{Y|X}(y_0|x)}\mathrm{d}x\}^{-1}\frac{f_{X|Y}(x|y_0)}{f_{Y|X}(y_0|x)} \tag{f1} \\
&\propto \frac{f_{X|Y}(x|y_0)}{f_{Y|X}(y_0|x)} \tag{f2}
\end{align}
\begin{table}[h]
\centering
\caption{The Inventor of IBF}
\begin{tabular}{|c|}
\hline
\includegraphics[width = .75\textwidth]{kaing.jpg} \\
\end{tabular}
\end{table}
There are more information on \textbf{inverse Bayes' formula}:
\begin{itemize}
\item \url{http://web.hku.hk/~kaing/Background.pdf}
\item \url{http://101.96.10.64/web.hku.hk/~kaing/Section1_3.pdf}
\item \url{http://web.hku.hk/~kaing/HKSSinterview.pdf}
\item \url{http://web.hku.hk/~kaing/HKSStalk.pdf}
\end{itemize}
\section{What determines a distribution?}
The cumulative density function (CDF) or probability density function(pdf) is roughly equal to random variable, i.e. one random variable is always attached with CDF or pdf. However, what we observed is not the variable itself but its realization or sample.
\begin{itemize}
\item In theory, what properties do some CDFs or pdfs hold? For example, are they all integrable?
\item In practice, the basic question is how to determine the CDF or pdf if we only observed some samples?
\end{itemize}
\subsection{Expectation, Variance and Entropy}
Expectation and variance are two important factors that characterize the random variable.
The expectation of a discrete random variable is defined as the weighted sum.
\begin{definition}{Mean}{Mean}
For a discrete random variable $X$, of which the range is ${x_1,\cdots, x_{\infty}}$, its mean $\mathbb{E}(X)$ is defined as $\mathbb{E}(X)=\sum_{i=1}^{\infty}x_i P(X=x_i)$.
\end{definition}
The mean of a discrete random variable is a weighted sum. Average is one special expectation with equiprob, i.e. $P(X=x_1)=P(X=x_2) = \cdots = P(X = x_i) = \cdots \forall i$.
The expectation of a continuous random variable is defined as one special integration.
\begin{definition}{Expectation}{E}
For a continuous random variable $X$ with the pdf $f(x)$, if the integration $\int_{-\infty}^{\infty}|x|f(x)\mathrm{d}x$ exists, the value $\int_{-\infty}^{\infty} xf(x)\mathrm{d}x$ is called the (mathematical) \textbf{expectation} of $X$, which is often denoted as $\mathbb{E}(X)$.
\end{definition}
Note that $\color{lime}{NOT}$ all random variables have expectation. For example, the expectation of standard \href{https://www.wikiwand.com/en/Cauchy_distribution}{Cauchy distribution}
$$f_X(x)=\frac{1}{\pi(1+x^2)}$$
is undefined.
The expectation is the center of the probability density function in many cases. What is more,
$$\arg\max_{b}\mathbb{E}(X-b)^2=\mathbb{E}(X)$$
which implies that $\mathbb{E}(X)$ is the most likeliest to appear in expectation.
\begin{definition}{Expectation of Random vector}{Exp}
Now suppose that X is a random vector $X = (X_1, \cdots, X_d )$, where $X_j$, $j = 1, \cdots, d,$ is real-valued. Then $\mathbb{E}(X)$ is simply the vector
$$(\mathbb{E}(X_1), \cdots , \mathbb{E}(X_d))$$
where $\mathbb{E}(X_i)=\int_{\mathbb{R}}x_if_{X_i}\mathrm{d}x_i\,\,\forall i\in\{1,2, \cdots, d\}$ and $f_{X_i}(x_i)$ is the marginal probability density function of $X_i$.
\end{definition}
\begin{definition}{Variance}{Var}
If the random variable has finite expectation $\mathbb{E}(X)$, then the expectation of $(X-\mathbb{E}(X))^2$ is called the variance of $X$ (denoted as $Var(X)$), i.e. $\sum_{i=1}^{\infty}(x_i-\mathbb{E}(X))^2P(X=x_i)$ for discrete random variable and $\int_{-\infty}^{\infty}(x-\mathbb{E}(X))^2f_X(x)\mathrm{d}x$ for continuous random variable.
\end{definition}
It is obvious that
$$Var(X)=\int_{\mathbb{R}}(x-\mathbb{E}(X))^2f_X(x)\mathrm{d}x=\int_{\mathbb{X}}(x-\mathbb{E}(X))^2f_X(x)\mathrm{d}x$$
where the set $\mathbb{X}$ is the support of $X$.
In general, let $X$ be a random variable with pdf $f_X(x)$, the expectation of the random variable $g(X)$ is equal to the integration $\int_{\mathbb{R}}g(x)f_X(x)\mathrm{d}x$ if it exists.
In analysis, the expectation of a random variable is the integration of some functions.
%**********************************************************
\begin{definition}{Conditional Expectation}{Conditional Expectation}
The conditional expectation of $Y$ given $X$ can be defined as
$$\Psi(X) =\mathbb{E}(Y|X)=\int_{\mathbb{R}} y f_{Y|X}(y|x) \mathrm{d}y.$$
\end{definition}
It is a \href{https://www.encyclopediaofmath.org/index.php/Parameter-dependent_integral}{parameter-dependent integral}, where the parameter $x$ can be considered as fixed constant. See \href{http://ocw.uc3m.es/matematicas/calculus-ii/C2/unit3.pdf}{the content in Calculus II}.
\begin{definition}{Tower Rule}{Tower Rule}
\href{https://www.wikiwand.com/en/Law_of_total_expectation}{Tower Rule}
Let $X$ be random variable on a sample space $\Omega$, let the events $A_1, A_2, \cdots$ are disjoint in the sample space $\Omega$ and $\bigcup_{i=1}^{\infty}A_i = \Omega$, $B$ is any subset of $\Omega$, $\mathbb{E}(X)=\sum_{i=1}^{\infty}\mathbb{E}(X|A_i)P(A_i)$. In general, the conditional expectation $\Psi(X)=\mathbb{E}(Y|X)$ satisfies $\mathbb{E}(\Psi(X))=\mathbb{E}(Y).$
\end{definition}
The probability of an event can be expressed as the expectation, i.e.
\begin{table}[h]
\centering
\caption{Probability as Integration}
\begin{tabular}{|c|}
\hline
$P(x\in A)= \int_{\mathbb{R}}\mathbb{I}_{A}f_X(x)\mathrm{d}x$ \\
\hline
\end{tabular}
\end{table}
where
\begin{equation}
\mathbb{I}_{A}=
\begin{cases}
1, & \text{if $x\in A$} \\
0, & \text{otherwise}
\end{cases}.
\end{equation}
It is called as the indictor function of $A$.
%******************************************************
\begin{definition}{Entropy}{Ent}
The Shannon entropy is defined as
$$ H=-\sum_{i=1}^{\infty}P(X=x_i){\ln}P(X=x_i) $$
for the discrete random variable $X$ with the range $\{x_1,\cdots, x_n\}$ with the convention $P(X=x)=0$ that $P(X=x){\ln}{\frac{1}{P(X=x)}}=0$ and
$$ H=\int_{\mathbb{X}}{\ln}(\frac{1}{f_X(x)})f_X(x)\mathrm{d}x $$
for the continuous random variable $X$ with the support $\mathbb{X}$.
\end{definition}
The Shannon entropy is often related to $\color{lime}{finite}$ state discrete random variable, i.e. $\color{teal}{n< \infty}$ and the value of random variable is not involved in its entropy.
\begin{table}[h]
\centering
\caption{Claude Elwood Shannon, 1916-2001}
\begin{tabular}{|c|}
\hline
\includegraphics[width = 1.0\textwidth]{shannon.jpg} \\
\hline
There is a \href{(http://colah.github.io/posts/2015-09-Visual-Information/}{Visual information} \\
at \url{http://colah.github.io/posts/2015-09-Visual-Information/}. \\
\hline
\end{tabular}
\end{table}
\subsection{Moment and Moment Generating Function}
In calculus, we know that some proper functions can be extended as a Taylor series in a interval.
Moment is a specific quantitative measure of the shape of a function.
\begin{definition}{Moments}{M}
The $n$-th moment of a real-valued continuous function $f_X(x)$ of a real variable about a value $c$ is
$$\mu_{n} =\int_{x\in\mathbb{R}}(x-c)^n f_X(x)\mathbb{d}x.$$
\end{definition}
And the constant $c$ always take the expectation $\mathbb{E}(X)$ or $0$.
\begin{definition}{Moment Generating Function}{MGF}
Moment generating function of a random variable $X$ is the expectation of the random variable of $e^{tX}$,i.e. $$M_X(t)=\mathbb{E}(e^{tX})$$.
\end{definition}
\begin{table}[h]
\centering
\caption{Moment generating function}
\begin{tabular}{|c|}
\hline
$M_X(t)=\int_{\mathbb{R}}e^{tx}f_X(x)\mathbb{d}x$ for continuous random variable \\
\hline
$M_{X}(t)=\sum_{i=1}^{\infty}e^{tx_{i}}P(x=x_i)$ for discrete random variable \\
\hline
\end{tabular}
\end{table}
It is \href{http://mathworld.wolfram.com/LaplaceTransform.html}{Laplace transformation} applied to probability density function. And it is also related with cumulants \url{http://scholarpedia.org/article/Cumulants}.
The moments are not unique, i.e. the different distribution may have the same moments such as
$${f}_1(x)=\frac{1}{\sqrt{2\pi}x}\exp(-{\log(x)}^2/2)$$
$${f}_2(x)={f}_1(x)(1+\sin(2\pi\log{x})).$$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Sampling Methods}
%There are some related links in web:
%***
%
%* [**Random number generation**](https://www.wikiwand.com/en/Random_number_generation).
%* [**List of Random number generating**](https://www.wikiwand.com/en/List_of_random_number_generators).
%* [**Pseudorandom number generator**](https://www.wikiwand.com/en/Pseudorandom_number_generator).
%* [**Non-uniform pseudo-random variate generation**](https://www.wikiwand.com/en/Pseudo-random_number_sampling#/Finite_discrete_distributions).
%* [**Sampling methods**](https://ermongroup.github.io/cs228-notes/inference/sampling/).
%* [**MCMC**](https://www.wikiwand.com/en/Monte_Carlo_method).
%* [**Visualizing MCMC**](https://twiecki.github.io/blog/2014/01/02/visualizing-mcmc/).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Sampling from Discrete Distribution}
\begin{definition}{Inverse transform technique}{inverse tech}
Let $F$ be a probability cumulative function of a random variable taking non-negative integer values, and let $U$ be uniformly distributed on interval $[0, 1]$.
The random variable given by $X=k$ if and only if $F(k-1)<U<F(k)$ has the distribution function $F$.
\end{definition}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsubsection{Sampling from Categorical Distribution}
The \emph{categorical distribution} (also called a \emph{generalized Bernoulli distribution}, \emph{multinoulli distribution}) is a discrete probability distribution that describes the possible results of a random variable that can take on one of \emph{K} possible categories, with the probability of each category separately specified.
%***
The category can be represented as \href{https://www.wikiwand.com/en/One-hot#/overview}{one-hot vector}, i.e. the vector $(1,0,\cdots, 0)$ is referred as the first category and the others are as similar as it. This representation is of some advantages:
\begin{enumerate}
\item Each category is identified by its position and equal to each other in norm;
\item The one-hot vectors can not be compared as the real number in value;
\item The probability mass function of the $K$ categories distribution can be written in a compact form - $P(\mathrm{X})=[p_1,p_2, \cdots, p_K]\cdot \mathrm{X}^T$,
where
\begin{itemize}
\item The probability $p_i \geq 0, \forall i\in [1,\cdots, K]$ and $\sum_{i=1}^{K}p_i=1$;
\item The random variable $\mathrm{X}$ is one-hot vector and $\mathrm{X}^T$ is the transpose of $X$.
\end{itemize}
\end{enumerate}
%***
Sampling it by \href{https://www.wikiwand.com/en/Inverse_transform_sampling}{inverse transform sampling}:
\begin{enumerate}
\item Pick a \href{https://www.wikiwand.com/en/Uniform_distribution_(continuous)}{uniformly distributed} number between 0 and 1.
\item Locate the greatest number in the CDF whose value is less than or equal to the number just chosen., i.e. $F^{-1}(u)=inf\{x: F(x) \leq u\}$.
\item Return the category corresponding to this CDF value.
\end{enumerate}
See more on \href{https://www.wikiwand.com/en/Categorical_distribution}{Categorical distribution}.
$\color{olive}{\text{The categorical variable cannot be ordered, how to compute the CDF?}}$
\subsection{Sampling from Continuous Distribution}
\subsubsection{Direct Methods}
\href{https://www.wikiwand.com/en/Inverse_transform_sampling)}{Inverse transform technique}
\begin{theorem}{Inverse transform technique}
Let $F$ be a probability cumulative function of a continuous random variable,
and let $U$ be uniformly distributed on interval $[0, 1]$.
The random variable $X=F^{-1}(U)$ has the distribution function $F$.
\end{theorem}
\emph{Khintchine’s (1938) theorem}: Suppose the random variable $X$ with density given by
$$ f_{X}(x)=\int_{x}^{\infty}z^{-1}f_Z(z)\mathrm{d}z $$
or This mixture can be represented equivalently by
\begin{align}
Z &\sim f_Z(z), z > 0 &\text{and} \tag 1\\
X|(Z=z) & \sim Uinf(0,z). \tag 2
\end{align}
Hence $\frac{X}{Z}|(Z=z)=\frac{X}{z}|(Z=z)\sim\,Unif(0,1)$ not depending on $z$, so that
\begin{align}
\frac{X}{Z}|(Z=z) =\frac{X}{z}|(Z=z) &\sim\,Unif(0,1) \\
\frac{X}{Z}\stackrel{d}=U &\sim Unif(0,1) \\
X & =ZU \tag 3
\end{align}
and $U$ and $Z$ are mutually independent.
If $\nabla f_X(x)$ exists and $f_X(\infty)=0$, we can obtain the following equation by Newton-Leibiniz's theorem
$$f_X(x)=-\int_{x}\nabla f_X(z)\mathrm{d}z $$
and comparing (4) and (0), it is obvious: $\nabla f_X(z)=-z^{-1}f_Z(z)$.
See more information on \href{https://www.jstor.org/stable/3087351?seq=1#page_scan_tab_contents}{On Khintchine's Theorem and Its Place in Random Variate Generation} and
\href{http://rspa.royalsocietypublishing.org/content/466/2119/2079}{Reciprocal symmetry, unimodality and Khintchine’s theorem}.
%%%%%#### Rejection sampling
\subsubsection{Rejection sampling}
The \href{https://www.wikiwand.com/en/Rejection_sampling}{rejection sampling} is to draw samples from a distribution with the help of a proposal distribution.
%***
%The algorithm (used by [John von Neumann](https://www.wikiwand.com/en/John_von_Neumann) and dating back to Buffon and [his needle](https://www.wikiwand.com/en/Buffon%27s_needle "Buffon's needle")) to obtain a sample from distribution $X$ with density $f$ using samples from distribution $Y$ with density $g$ is as follows:
1. Obtain a sample $y$ from distribution $Y$ and a sample $u$ from $\mathrm{Unif}(0,1)$(the uniform distribution over the unit interval).
2. Check whether or not $u<f(y)/Mg(y)$.
\begin{itemize}
\item If this holds, accept $y$ as a sample drawn from $f$;
\item if not, reject the value of $y$ and return to the sampling step.
\end{itemize}
%***
The algorithm will take an average of $M$ iterations to obtain a sample.
\href{https://www.wikiwand.com/en/Ziggurat_algorithm}{Ziggural algorithm} is an application of rejection sampling to draw samples from Gaussian distribution.
%|[John von Neumann, 1903-1957](https://www.wikiwand.com/en/John_von_Neumann)|
%|:-------------------------------------------------------------------------:|
%|![](https://www.azquotes.com/picture-quotes/quote-anyone-who-attempts-to-generate-random-numbers-by-deterministic-means-is-of-course-living-john-von-neumann-21-31-61.jpg)|
\includegraphics[width = 0.9\textwidth]{john-von-neumann.jpg}
\subsubsection{Sampling-importance-resampling}
It is also called SIR method in short. As name shown, it consists of two steps: sampling and importance sampling.
The SIR method generates an approximate i.i.d. sample of size $m$ from the target density
$f(x),x\in \mathbb{X}\subset\mathbb{R}^n.$.
%***
The SIR without replacement is as following:
\begin{enumerate}
\item Draw $X^{(1)},X^{(2)},\cdots,X^{(J)}$ independently from the proposal density $g(\cdot)$.
\item Select a subset $\{X^{(k_i)}\}_{i=1}^{m}$ from $\{X^{(i)}\}_{i=1}^{J}$ via resampling without replacement from the discrete distribution $\{\omega_i\}_{i=1}^{J}$
where $w_i=\frac{f(X^{(i)})}{g(X^{(i)})}$ and $\omega_i=\frac{w_i}{\sum_{i=1}^{n}w_i}$.
\end{enumerate}
\subsubsection{The Conditional Sampling Method}
The conditional sampling method due to the prominent Rosenblatt transformation is particularly available
when the joint distribution of a $d$ vector is very difficult to generate but one marginal distribution and $d-1$ univariate conditional distributions are easy to simulate.
It is based on the chain rule of probability:
$$ f(x)=f(x_d)\prod_{i=1}^{d-1}f_{k}( x_k |x_{k+1}, x_{k+2},\cdots, x_d ) $$
where $x=(x_1,x_2,\cdots, x_d)^{T}$ and $f(x)$ is the probability density function.
To generate $X$ from $f(x)$, we only need to generate $x_d$ from the marginal
density $f_d(x_d)$, then to generate $x_k$ sequentially from the conditional density
$f_k(x_k|x_{k+1}, x_{k+2}, \cdots, x_d)$.
%##### The Vertical Density Representation Method
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Numerical Optimization}
IN \href{https://homes.cs.washington.edu/~pedrod/papers/cacm12.pdf}{A Few Useful Things to Know about Machine Learning}, Pedro Domingos put up a relation:
$$\color{red}{LEARNING = REPRESENTATION + EVALUATION + OPTIMIZATION}.$$
\begin{itemize}
\item Representation as the core of the note is the general (mathematical) **model** that computer can handle.
\item Evaluation is \textbf{criteria}. An evaluation function (also called objective function, cost function or scoring function) is needed to distinguish good classifiers from bad ones.
\item Optimization is to aimed to find the parameters that optimizes the evaluation function, i.e.
$$ \arg\min_{\theta} f(\theta)=\{\theta^*|f(\theta^*)=\min f(\theta)\}\,\text{or}\,\arg\max_{\theta}f(\theta)=\{\theta^*|f(\theta^*)=\max f(\theta)\}. $$
\end{itemize}
%***********************************************
The objective function to be minimized is also called cost function.
Evaluation is always attached with optimization; the evaluation which cannot be optimized is not a good evaluation in machine learning.
\section{Gradient Descent and More}
Each iteration of a line search method computes a search direction $p^{k}$ and then decides how
far to move along that direction. The iteration is given by
$$ x^{k+1}=x^{k}+\alpha_{k}p^{k}\tag{Line search} $$
where the positive scalar $\alpha^{k}$ is called the step length. The success of a line search method
depends on effective choices of both the direction $p^{k}$ and the step length $\alpha_{k}$.
$\color{lime}{Note}$: we use the notation $x^{k}$ and $\alpha_k$ to represent the $k$th iteration of the vector variables $x$ and $k$th step length, respectively.
Most line search algorithms require pk to be a descent direction — one for which
$\left< {p^k},\nabla f_k \right> < 0$ — because this property guarantees that the function $f$ can be reduced along this direction, where $\nabla f_k$ is the gradient of objective function $f$ at the $k$th iteration point $x_k$ i.e. $\nabla f_k=\nabla f(x^{k})$.
%***
Gradient descent and its variants are to find the local solution of the unconstrained optimization problem:
$$
\min f(x)
$$
where $x\in \mathbb{R}^{n}$.
Its iterative procedure is:
$$x^{k+1}=x^{k}-\alpha_{k}\nabla_{x}f(x^k)$$
where $x^{k}$ is the $k$th iterative result, $\alpha_{k}\in\{\alpha|f(x^{k+1})< f(x^{k})\}$ and particularly $\alpha_{k}=\arg\min_{\alpha}\{f(x^{k}-\alpha\nabla_{x}f(x^{k}))\}$.
%****
Some variants of gradient descent methods are not line search method.
For example, the \textbf{heavy ball method}:
$$
x^{k+1}=x^{k}-\alpha_{k}\nabla_{x}f(x^k)+\rho_{k}(x^k-x^{k-1})
$$
where the momentum coefficient $\rho_k\in[0,1]$ generally and the step length $\alpha_k$ cannot be determined by line search.
\textbf{Nesterov accelerated gradient method} is defined by
\begin{align}
x^{k}=y^{k}-\alpha^{k+1}\nabla_{x}f(y^k) \qquad &\text{Descent} \\
y^{k+1}=x^{k}+\rho^{k}(x^{k}-x^{k-1}) \qquad &\text{Momentum}
\end{align}
where the momentum coefficient $\rho_k\in[0,1]$ generally.
\begin{table}[h]
\centering
\caption{Inventor of Nesterov accelerated Gradient}
\begin{tabular}{|c|}
\hline
\includegraphics[width = 0.9\textwidth]{Nesterov_yurii.jpg} \\
\hline
\end{tabular}
\end{table}
%* https://www.wikiwand.com/en/Gradient_descent
%* http://wiki.fast.ai/index.php/Gradient_Descent
%* https://blogs.princeton.edu/imabandit/2013/04/01/acceleratedgradientdescent/
%* https://blogs.princeton.edu/imabandit/2015/06/30/revisiting-nesterovs-acceleration/
%* http://awibisono.github.io/2016/06/20/accelerated-gradient-descent.html
%* https://jlmelville.github.io/mize/nesterov.html
%* https://smartech.gatech.edu/handle/1853/60525
%* https://zhuanlan.zhihu.com/p/41263068
%* https://zhuanlan.zhihu.com/p/35692553
%* https://zhuanlan.zhihu.com/p/35323828
\section{Mirror Gradient Method}
It is often called \textbf{mirror descent}.
It can be regarded as non-Euclidean generalization of \textbf{projected gradient descent} to solve some constrained optimization problems.
\subsection{Projected Gradient Descent}
\textbf{Projected gradient descent} is aimed to solve convex optimization problem with explicit constraints, i.e.
$$
\arg\min_{x\in\mathbb{S}}f(x)
$$
where $\mathbb{S}\subset\mathbb{R}^n$.
It has two steps:
\begin{align}
z^{k+1} = x^{k}-\alpha_k\nabla_x f(x^{k}) &\qquad \text{Gradient descent}\\
x^{k+1} = Proj_{\mathbb{S}}(z^{k+1})=\arg\min_{x\in \mathbb{S}}\|x-z^{k+1}\|^{2} &\qquad\text{Projection}
\end{align}
\subsection{Mirror Descent}
\textbf{Mirror descent} can be regarded as the non-Euclidean generalization via replacing the $\ell_2$ norm or Euclidean distance in projected gradient descent by \href{https://www.mdpi.com/1099-4300/16/12/6338/htm}{Bregman divergence}.
Bregman divergence is induced by convex smooth function $f$:
$$
B(x,y)=f(x)-f(y)-\left<\nabla f(y),x-y\right>
$$
where $\left<\cdot,\cdot\right>$ is inner product.
Especially, when $f$ is quadratic function, the Bregman divergence induced by $f$ is
$$
B(x,y)=x^2-y^2-\left<2y,x-y\right>=x^2+y^2-2xy=(x-y)^2
$$
i.e. the Euclidean distance.
A wonderful introduction to Bregman divergence is \textbf{Meet the Bregman Divergences} by \href{http://mark.reid.name}{Mark Reid} at \url{http://mark.reid.name/blog/meet-the-bregman-divergences.html}.
%***
It is given by:
\begin{align}
z^{k+1} = x^{k}-\alpha_k\nabla_x f(x^{k}) &\qquad \text{Gradient descent}\\
x^{k+1} = \arg\min_{x\in\mathbb{S}}B(x,z^{k+1}) &\qquad\text{Bregman projection}
\end{align}
One special method is called \textbf{entropic mirror descent} when $f=e^x$ and $\mathbb{S}$ is simplex.
See more on the following link list.
%* http://users.cecs.anu.edu.au/~xzhang/teaching/bregman.pdf
%* https://zhuanlan.zhihu.com/p/34299990
%* https://blogs.princeton.edu/imabandit/2013/04/16/orf523-mirror-descent-part-iii/
%* https://blogs.princeton.edu/imabandit/2013/04/18/orf523-mirror-descent-part-iiii/
%* https://www.stat.berkeley.edu/~bartlett/courses/2014fall-cs294stat260/lectures/mirror-descent-notes.pdf
\section{Variable Metric Methods}
\subsection{Newton's Method}
NEWTON’S METHOD and QUASI-NEWTON METHODS are classified to variable metric methods.
It is also to find the solution of unconstrained optimization problems, i.e.
$$\min f(x)$$
where $x\in \mathbb{R}^{n}$.
%***
\textbf{Newton's method} is given by
$$
x^{k+1}=x^{k}-\alpha^{k+1}H^{-1}(x^{k})\nabla_{x}\,{f(x^{k})}
$$
where $H^{-1}(x^{k})$ is inverse of the Hessian matrix of the function $f(x)$ at the point $x^{k}$.
It is called \textbf{Newton–Raphson algorithm} in statistics.
Especially when the log-likelihood function $\ell(\theta)$ is well-behaved,
a natural candidate for finding the MLE is the Newton–Raphson algorithm with quadratic convergence rate.
\subsection{The Fisher Scoring Algorithm}
In maximum likelihood estimation, the objective function is the log-likelihood function, i.e.
$$
\ell(\theta)=\sum_{i=1}^{n}\log{P(x_i|\theta)}
$$
where $P(x_i|\theta)$ is the probability of realization $X_i=x_i$ with the unknown parameter $\theta$.
However, when the sample random variable $\{X_i\}_{i=1}^{n}$ are not observed or realized, it is best to
replace negative Hessian matrix (i.e. -$\frac{\partial^2\ell(\theta)}{\partial\theta\partial\theta^{T}}$) of the likelihood function with the
\textbf{observed information matrix}:
$$
J(\theta)=\mathbb{E}(\color{red}{\text{-}}\frac{\partial^2\ell(\theta)}{\partial\theta\partial\theta^{T}})=\color{red}{-}\int\frac{\partial^2\ell(\theta)}{\partial\theta\partial\theta^{T}}f(x_1, \cdots, x_n|\theta)\mathrm{d}x_1\cdots\mathrm{d}x_n
$$
where $f(x_1, \cdots, x_n|\theta)$ is the joint probability density function of $X_1, \cdots, X_n$ with unknown parameter $\theta$.
And the \textbf{Fisher scoring algorithm} is given by
$$\theta^{k+1}=\theta^{k}+\alpha_{k}J^{-1}(\theta^{k})\nabla_{\theta} \ell(\theta^{k})$$
where $J^{-1}(\theta^{k})$ is the inverse of observed information matrix at the point $\theta^{k}$.
See \url{http://www.stats.ox.ac.uk/~steffen/teaching/bs2HT9/scoring.pdf} or \url{https://wiseodd.github.io/techblog/2018/03/11/fisher-information/} for more information.
Fisher scoring algorithm is regarded as an example of \textbf{Natural Gradient Descent} in
information geometry such as \url{https://wiseodd.github.io/techblog/2018/03/14/natural-gradient/}.
\subsection{Quasi-Newton Methods}
Quasi-Newton methods, like steepest descent, require only the gradient of the objective
function to be supplied at each iterate.
By measuring the changes in gradients, they construct a model of the objective function
that is good enough to produce superlinear convergence.
The improvement over steepest descent is dramatic, especially on difficult
problems. Moreover, since second derivatives are not required, quasi-Newton methods are
sometimes more efficient than Newton's method.
In optimization, quasi-Newton methods (a special case of 、textbf{variable-metric methods}) are algorithms for finding local maxima and minima of functions.
Quasi-Newton methods are based on Newton's method to find the stationary point of a function, where the gradient is $0$.
In quasi-Newton methods the Hessian matrix does not need to be computed. The Hessian is updated by analyzing successive gradient vectors instead. Quasi-Newton methods are a generalization of the secant method to find the root of the first derivative for multidimensional problems. In multiple dimensions the secant equation is under-determined, and quasi-Newton methods differ in how they constrain the solution, typically by adding a simple low-rank update to the current estimate of the Hessian.
One of the chief advantages of quasi-Newton methods over Newton's method is that the Hessian matrix (or, in the case of quasi-Newton methods, its approximation) $B$ does not need to be inverted. The Hessian approximation $B$ is chosen to satisfy
$$ \nabla f(x^{k+1})=\nabla f(x^{k})+B(x^{k+1}-x^{k}), $$
which is called the \textbf{secant equation} (the Taylor series of the gradient itself).
In more than one dimension $B$ is underdetermined. In one dimension, solving for B and applying the Newton's step with the updated value is equivalent to the \href{https://www.wikiwand.com/en/Secant_method}{secant method}.
The various quasi-Newton methods differ in their choice of the solution to the \emph{secant equation} (in one dimension, all the variants are equivalent).
%![BFGS](http://aria42.com/images/bfgs.png)
%***
%
%* [Wikipedia page](https://www.wikiwand.com/en/Newton%27s_method_in_optimization)
%* [Newton-Raphson Visualization (1D)](http://bl.ocks.org/dannyko/ffe9653768cb80dfc0da)
%* [Newton-Raphson Visualization (2D)](http://bl.ocks.org/dannyko/0956c361a6ce22362867)
%* [Newton's method](https://www.wikiwand.com/en/Newton%27s_method)
%* [Quasi-Newton method](https://www.wikiwand.com/en/Quasi-Newton_method)
%* [Using Gradient Descent for Optimization and Learning](http://www.gatsby.ucl.ac.uk/teaching/courses/ml2-2008/graddescent.pdf)
%* http://fa.bianp.net/teaching/2018/eecs227at/quasi_newton.html
\subsection{Natural Gradient Descent}
\textbf{Natural gradient descent} is to solve the optimization problem $\min_{\theta} L(\theta)$ by
$$ \theta^{(t+1)}=\theta^{(t+1)}-\alpha_{(t)}F^{-1}(\theta^{(t)})\nabla_{\theta}L(\theta^{(t)}) $$
where $F^{-1}(\theta^{(t)})$ is the inverse of Remiann metric at the point $\theta^{(t)}$.
And Fisher scoring algorithm is a typical application of Natural Gradient Descent to statistics.
\textbf{Natural gradient descent} for manifolds corresponding to
exponential families can be implemented as a first-order method through \emph{mirror descent} at \url{https://www.stat.wisc.edu/~raskutti/publication/MirrorDescent.pdf}.
\begin{table}[h]
\centering
\caption{Originator of Information Geometry: Shun-ichi Amari(甘利 俊一)}
\begin{tabular}{|c|}
\hline
\includegraphics[width = 0.80\textwidth]{shun-ichi-amari.jpg} \\
\hline
\end{tabular}
\end{table}
%| Originator of Information Geometry |
%|:----:|
%|![Shun-ichi Amari](https://groups.oist.jp/sites/default/files/imce/u34/images/people/shun-ichi-amari.jpg)|
%* http://www.yann-ollivier.org/rech/publs/natkal.pdf
%* http://www.dianacai.com/blog/2018/02/16/natural-gradients-mirror-descent/
%* https://www.zhihu.com/question/266846405
%* http://bicmr.pku.edu.cn/~dongbin/Conferences/Mini-Course-IG/index.html
%* http://ipvs.informatik.uni-stuttgart.de/mlr/wp-content/uploads/2015/01/mathematics_for_intelligent_systems_lecture12_notes_I.pdf
%* http://www.luigimalago.it/tutorials/algebraicstatistics2015tutorial.pdf
%* http://www.yann-ollivier.org/rech/publs/tango.pdf
%* http://www.brain.riken.jp/asset/img/researchers/cv/s_amari.pdf
\section{ Expectation Maximization Algorithm}
\textbf{Expectation-Maximization algorithm}, popularly known as the EM algorithm has become a standard piece in the statistician's repertoire.
It is used in incomplete-data problems or latent-variable problems such as Gaussian mixture model in maximum likelihood estimation.
The basic principle behind the EM is that instead of performing a complicated optimization,
one augments the observed data with latent data to perform a series of simple optimizations.
Let $\ell(\theta|Y_{obs})\stackrel{\triangle}=\log{L(\theta|Y_{obs})}$ denote the log-likelihood function of observed datum $Y_{obs}$.
We augment the observed data $Y_{obs}$ with latent variables $Z$ so that both the
complete-data log-likelihood $\ell(\theta|Y_{obs}, Z)$ and the conditional predictive distribution $f(z|Y_{obs}, \theta)$ are available.
Each iteration of the EM algorithm consists of an expectation step (E-step) and a maximization step (M-step)
Specifically, let $\theta^{(t)}$ be the current best guess at the MLE $\hat\theta$. The E-step
is to compute the \textbf{Q} function defined by
\begin{align}
Q(\theta|\theta^{(t)})
&= \mathbb{E}(\ell(\theta|Y_{obs}, Z)|Y_{obs},\theta^{(t)}) \\
&= \int_{Z}\ell(\theta|Y_{obs}, Z)\times f(z|Y_{obs}, \theta^{(t)})\mathrm{d}z,
\end{align}
and the M-step is to maximize **Q** with respect to $\theta$ to obtain
$$\theta^{(t+1)}=\arg\max_{\theta} Q(\theta|\theta^{(t)}).$$
%* https://www.wikiwand.com/en/Expectation%E2%80%93maximization_algorithm
%* http://cs229.stanford.edu/notes/cs229-notes8.pdf
%* https://www2.stat.duke.edu/courses/Spring06/sta376/Support/EM/EM.Mixtures.Figueiredo.2004.pdf
\begin{table}[h]
\centering
\caption{Diagram of EM algorithm}
\begin{tabular}{|c|}
\hline
\includegraphics[width = 1.0\textwidth]{EM.png} \\
\hline
\end{tabular}
\end{table}
%|Diagram of EM algorithm|
%|:---------------------:|
%|![](https://i.stack.imgur.com/v5bqe.png)|
%EM.png
\subsection{Generalized EM Algorithm}
Each iteration of the \textbf{generalized EM} algorithm consists of an expectation step (E-step) and an ascent step instead of maximization step (M-step).
Specifically, let $\theta^{(t)}$ be the current best guess at the MLE $\hat\theta$. The E-step
is to compute the **Q** function defined by
\begin{align}
Q(\theta|\theta^{(t)}) &= \mathbb{E}(\ell(\theta|Y_{obs}, Z)|Y_{obs},\theta^{(t)}) \\
&= \int_{Z}\ell(\theta|Y_{obs}, Z)\times f(z|Y_{obs}, \theta^{(t)})\mathrm{d}z,
\end{align}
and the another step is to find $\theta$ that satisfies $Q(\theta^{t+1}|\theta^{t})>Q(\theta^{t}|\theta^{t})$, i.e.
$$\theta^{(t+1)}\in \{\hat{\theta}|Q(\hat{\theta}|\theta^{(t)} \geq Q(\theta|\theta^{(t)}) \}.$$
It is not to maximize the conditional expectation.
See more on the book \textbf{The EM Algorithm and Extensions, 2nd Edition
by Geoffrey McLachlan , Thriyambakam Krishna} at \url{https://www.wiley.com/en-cn/The+EM+Algorithm+and+Extensions,+2nd+Edition-p-9780471201700}.
See more on \url{https://www.stat.berkeley.edu/~aldous/Colloq/lange-talk.pdf}
\section{Alternating Direction Method of Multipliers}
Alternating direction method of multipliers is called \textbf{ADMM} shortly.
It is aimed to solve the following convex optimization problem:
\begin{align}
\min F(x,y) \{&=f(x)+g(y)\} \tag {cost function} \\
Ax+By &=b \tag{constraint}
\end{align}
where $f(x)$ and $g(y)$ are convex; $A$ and $B$ are matrices.
Define the augmented Lagrangian:
$$ L_{\mu}(x,y)=f(x)+g(y)+\lambda^{T}(Ax+By-b)+\frac{\mu}{2}\|Ax+By-b\|_{2}^{2}. $$
%***
It is iterative procedure at $k$th step:
\begin{enumerate}
\item $x^{k+1}=\arg\min_{x}L_{\mu}(x,y^{\color{teal}{k}},\lambda^{\color{teal}{k}});$
\item $y^{k+1}=\arg\min_{y} L_{\mu}(x^{\color{red}{k+1}}, y, \lambda^{\color{teal}{k}});$
\item $\lambda^{k+1} = \lambda^{k}+\mu (Ax^{\color{red}{k+1}} + By^{\color{red}{k+1}}-b).$
\end{enumerate}
\begin{algorithm}
\caption{ADMM}
\label{ADMM}
\begin{algorithmic}
\REQUIRE $\text{the initial points:}\quad x_0, y_0, {\lambda}_0$
\ENSURE $k = 0$
\WHILE{$k \neq N$}
%\IF{$N$ is even}
\STATE $x^{k+1}=\arg\min_{x}L_{\mu}(x,y^{\color{teal}{k}},\lambda^{\color{teal}{k}})$
\STATE $y^{k+1}=\arg\min_{y} L_{\mu}(x^{\color{red}{k+1}}, y, \lambda^{\color{teal}{k}})$
\STATE $\lambda^{k+1} = \lambda^{k}+\mu (Ax^{\color{red}{k+1}} + By^{\color{red}{k+1}}-b)$
\STATE $k \Leftarrow k + 1$
%\ENDIF
\ENDWHILE
\end{algorithmic}
\end{algorithm}
%$\color{teal}{\text{Thanks to Professor He Bingsheng who taught me this.}}$
\begin{note}
Thanks to \href{http://maths.nju.edu.cn/~hebma/}{Professor He Bingsheng} who taught me this.
\end{note}
%* https://www.ece.rice.edu/~tag7/Tom_Goldstein/Split_Bregman.html
%* http://maths.nju.edu.cn/~hebma/
%* http://stanford.edu/~boyd/admm.html
%* http://shijun.wang/2016/01/19/admm-for-distributed-statistical-learning/
%* https://www.wikiwand.com/en/Augmented_Lagrangian_method
%* https://blog.csdn.net/shanglianlm/article/details/45919679
%* http://www.optimization-online.org/DB_FILE/2015/05/4925.pdf