-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathentropy.lyx
1509 lines (1144 loc) · 27.2 KB
/
entropy.lyx
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
#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass article
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Title
Entropy
\end_layout
\begin_layout Abstract
The language-learning diary entertains a recurring theme of entropy and
various related principles.
Although there are many, many, many resources for these concepts, it seems
convenient to put them here, all in one place, in an overview form, as
a handy quick-reference and refresher.
The content here is extracted from various texts.
\end_layout
\begin_layout Section
Fast Overview
\end_layout
\begin_layout Standard
A generic fast overview.
The rest of this text is organized as ...
\end_layout
\begin_layout Subsection
Partition Function
\end_layout
\begin_layout Standard
See Wikipedia
\begin_inset Quotes eld
\end_inset
Partition function
\begin_inset Quotes erd
\end_inset
\begin_inset CommandInset citation
LatexCommand cite
key "WP-Partition"
literal "true"
\end_inset
for more.
\end_layout
\begin_layout Itemize
States denoted by
\begin_inset Formula $\sigma$
\end_inset
(spins, from Ising model) with distribution
\begin_inset Formula $p\left(\sigma\right)$
\end_inset
.
\end_layout
\begin_layout Itemize
In machine learning, one writes
\begin_inset Formula $x$
\end_inset
for
\begin_inset Formula $\sigma$
\end_inset
.
In probability theory, one writes
\begin_inset Formula $X=x$
\end_inset
for
\begin_inset Formula $\sigma$
\end_inset
, where
\begin_inset Formula $X$
\end_inset
is distribution, and
\begin_inset Formula $x$
\end_inset
is a specific sampling of that distribution.
That is,
\begin_inset Formula $p\left(\sigma\right)$
\end_inset
is the same thing as
\begin_inset Formula $P\left(X=x\right)$
\end_inset
.
\end_layout
\begin_layout Itemize
\begin_inset Formula $\sigma$
\end_inset
is an indexed set, with
\begin_inset Formula $N$
\end_inset
elements.
As such, one can pretend that it is an
\begin_inset Formula $N$
\end_inset
–dimensional vector, which is fine
\begin_inset Quotes eld
\end_inset
for most practical purposes
\begin_inset Quotes erd
\end_inset
, but in rare cases can lead to confusion.
\end_layout
\begin_layout Itemize
One is often (usually) interested in the large–
\begin_inset Formula $N$
\end_inset
limit, i.e.
\begin_inset Formula $N\gg1$
\end_inset
i.e.
\begin_inset Formula $N\to\infty$
\end_inset
states.
\end_layout
\begin_layout Itemize
The
\begin_inset Quotes eld
\end_inset
energy
\begin_inset Quotes erd
\end_inset
of a state is
\begin_inset Formula $E\left(\sigma\right)=-\log p\left(\sigma\right)+\mbox{const}.$
\end_inset
\end_layout
\begin_layout Itemize
The density of states is:
\begin_inset Formula $\rho(E)=\sum_{\sigma}\delta(E-E(\sigma))$
\end_inset
\end_layout
\begin_layout Itemize
Total entropy is
\begin_inset Formula $S\left(E\right)=\log\rho\left(E\right)$
\end_inset
\end_layout
\begin_layout Itemize
Both the energy and the entropy contain the leading large-
\begin_inset Formula $N$
\end_inset
term i.e.
they are extensive properties.
\end_layout
\begin_layout Itemize
Without loss of generality, can write the Boltzmann distribution
\begin_inset Formula
\[
p\left(\sigma|\beta\right)=\frac{1}{Z\left(\beta\right)}\exp-N\sum_{i}\beta_{i}H_{i}\left(\sigma\right)
\]
\end_inset
where there are
\begin_inset Formula $M$
\end_inset
parameters
\begin_inset Formula $\beta_{i}$
\end_inset
called order parameters, Lagrange multipliers, etc.
and the
\begin_inset Formula $H_{i}\left(\sigma\right)$
\end_inset
are constants of motion.
\begin_inset Quotes eld
\end_inset
Without loss of generality
\begin_inset Quotes erd
\end_inset
means that any probability distribution can always be written in the above
form.
\end_layout
\begin_layout Itemize
In probability theory and information geometry, one often writes
\begin_inset Formula $\theta$
\end_inset
instead of
\begin_inset Formula $\beta$
\end_inset
as the parameter, and
\begin_inset Formula $f_{i}$
\end_inset
instead of
\begin_inset Formula $H_{i}$
\end_inset
.
\end_layout
\begin_layout Itemize
In machine learning, one often writes
\begin_inset Formula $w$
\end_inset
instead of
\begin_inset Formula $\beta$
\end_inset
.
In this case,
\begin_inset Formula $w$
\end_inset
is a
\begin_inset Quotes eld
\end_inset
weight vector
\begin_inset Quotes erd
\end_inset
, allowing a neural-net interpretation.
\end_layout
\begin_layout Itemize
The partition function is
\begin_inset Formula
\[
Z\left(\beta\right)=\sum_{\sigma}\exp-N\sum_{i}\beta_{i}H_{i}\left(\sigma\right)
\]
\end_inset
\end_layout
\begin_layout Itemize
The above describes a
\begin_inset Quotes eld
\end_inset
pure state
\begin_inset Quotes erd
\end_inset
, where the parameters
\begin_inset Formula $\beta{}_{i}$
\end_inset
are fixed constants.
This is in contrast to a
\begin_inset Quotes eld
\end_inset
mixed state
\begin_inset Quotes erd
\end_inset
, which is a distribution over
\begin_inset Formula $\beta$
\end_inset
.
\end_layout
\begin_layout Subsection
Fisher Information Metric
\end_layout
\begin_layout Standard
See Wikipedia,
\begin_inset Quotes eld
\end_inset
Fisher Information Metric: for details.
For a finite set of probabilities, we have
\end_layout
\begin_layout Itemize
Normalization:
\begin_inset Formula $\sum_{i}p_{i}=1$
\end_inset
\end_layout
\begin_layout Itemize
Entropy:
\begin_inset Formula $H=\sum_{i}p_{i}\log p_{i}$
\end_inset
\end_layout
\begin_layout Itemize
Metric: write
\begin_inset Formula $\psi_{i}=\sqrt{p_{i}}$
\end_inset
Then the normalization becomes
\begin_inset Formula $\sum_{i}\psi_{i}^{2}=1$
\end_inset
is an octant of a sphere.
The flat space Eucliden metric, projected onto the sphere, is the Fisher
information metric.
\end_layout
\begin_layout Section
Various definitions of entropy
\end_layout
\begin_layout Standard
XXX TODO there are other entropies, e.g.
microcanonincal, etc.
define them too.
\end_layout
\begin_layout Section
Geometric interpretations of Entropy
\end_layout
\begin_layout Standard
Confused attempts to find gemoetric interpretations.
\end_layout
\begin_layout Subsection
From Banach norms
\end_layout
\begin_layout Standard
I've never seen the below set into writing before.
I'm not sure what it means.
Given a set of probabilities
\begin_inset Formula $p_{i}$
\end_inset
, define the sum
\begin_inset Formula
\[
s_{q}=\sum_{i}p_{i}^{q}
\]
\end_inset
for some number
\begin_inset Formula $q$
\end_inset
.
The first derivative is
\begin_inset Formula
\begin{align*}
\left.\frac{d}{dq}s_{q}\right|_{q=1}= & \left.\frac{d}{dq}\sum_{i}\exp q\log p_{i}\right|_{q=1}\\
= & \left.\sum_{i}p_{i}^{q}\log p_{i}\right|_{q=1}\\
= & \sum_{i}p_{i}\log p_{i}
\end{align*}
\end_inset
which is the conventional entropy.
The Banach space
\begin_inset Formula $\ell_{q}$
\end_inset
norm is
\begin_inset Formula
\[
\ell_{q}=\left[s_{q}\right]^{1/q}
\]
\end_inset
and so
\begin_inset Formula
\begin{align*}
\frac{d}{dq}\ell_{q}= & \frac{d}{dq}\exp\frac{1}{q}s_{q}\\
= & \ell_{q}\frac{d}{dq}\frac{s_{q}}{q}\\
= & \ell_{q}\left(\frac{-s_{q}}{q^{2}}+\frac{1}{q}\frac{ds_{q}}{dq}\right)
\end{align*}
\end_inset
Then evaluating at
\begin_inset Formula $q=1$
\end_inset
one gets
\begin_inset Formula
\begin{align*}
\left.\frac{d}{dq}\ell_{q}\right|_{q=1}= & -\left(\sum_{i}p_{i}\right)^{2}+\sum_{i}p_{i}\log p_{i}\\
= & -1+\sum_{i}p_{i}\log p_{i}
\end{align*}
\end_inset
assuming that
\begin_inset Formula $\sum_{i}p_{i}=1$
\end_inset
for conventional probabilities.
\end_layout
\begin_layout Standard
This reinterprets the entropy as a kind of tangent vector.
What is the interpretation of that tangent vector? What does it
\begin_inset Quotes eld
\end_inset
mean
\begin_inset Quotes erd
\end_inset
?
\end_layout
\begin_layout Section
Zipf's Law, Hidden variable models
\end_layout
\begin_layout Standard
Zipf's law can arise whenever one has that some (not necessarily all) of
the order parameters are
\begin_inset Quotes eld
\end_inset
rapidly fluctuating
\begin_inset Quotes erd
\end_inset
, or are
\begin_inset Quotes eld
\end_inset
unknown
\begin_inset Quotes erd
\end_inset
, or are
\begin_inset Quotes eld
\end_inset
latent
\begin_inset Quotes erd
\end_inset
and must be
\begin_inset Quotes eld
\end_inset
averaged over
\begin_inset Quotes erd
\end_inset
to obtain a distribution.
The primary reference for this section is Schwab,
\emph on
et al
\emph default
,
\begin_inset Quotes eld
\end_inset
Zipf’s law and criticality in multivariate data without fine-tuning
\begin_inset Quotes erd
\end_inset
.
\begin_inset CommandInset citation
LatexCommand cite
key "Schwab2014"
literal "true"
\end_inset
See also Aitchison
\emph on
et al
\emph default
.,
\begin_inset Quotes eld
\end_inset
Zipf's Law Arises Naturally When There Are Underlying, Unobserved Variables
\begin_inset Quotes erd
\end_inset
\begin_inset CommandInset citation
LatexCommand cite
key "Aitchison2016"
literal "true"
\end_inset
for a less physics-oriented exposition.
\end_layout
\begin_layout Standard
Both Aitchison and also Mora
\emph on
etal
\emph default
.
\begin_inset Quotes eld
\end_inset
Are biological systems poised at criticality?
\begin_inset Quotes erd
\end_inset
\begin_inset CommandInset citation
LatexCommand cite
key "Mora2011"
literal "true"
\end_inset
articulate relationships to Ising models.
\end_layout
\begin_layout Subsection
Zipf's Law
\end_layout
\begin_layout Standard
A quick articulation of Zipf's law, based on
\begin_inset CommandInset citation
LatexCommand cite
key "Aitchison2016"
literal "true"
\end_inset
and
\begin_inset CommandInset citation
LatexCommand cite
key "Mora2011"
literal "true"
\end_inset
:
\end_layout
\begin_layout Itemize
Zipf's law is the statement that
\begin_inset Formula $p\left(\sigma\right)\sim1/\mbox{rank}\left(\sigma\right)$
\end_inset
.
\end_layout
\begin_layout Itemize
Converting to energy notation, where
\begin_inset Formula $E=E\left(\sigma\right)=-\log p\left(\sigma\right)$
\end_inset
as before, one can write Zipf's law as
\begin_inset Formula
\[
\log\mbox{ rank}\left(E\right)=E+const
\]
\end_inset
\end_layout
\begin_layout Itemize
The rank of a given, fixed state
\begin_inset Formula $\sigma$
\end_inset
can directly understood as the number of states
\begin_inset Formula $n\left(E\right)$
\end_inset
with energy less than
\begin_inset Formula $E=E\left(\sigma\right)$
\end_inset
.
That is,
\begin_inset Formula
\[
\mbox{rank}\left(\sigma\right)=n\left(E\left(\sigma\right)\right)=\int_{-\infty}^{E\left(\sigma\right)}dE^{\prime}\rho\left(E^{\prime}\right)
\]
\end_inset
where
\begin_inset Formula $\rho(E)$
\end_inset
is the density of states, as before.
\end_layout
\begin_layout Itemize
Equivalently, the derivative of the rank is exactly the density of states:
\end_layout
\begin_layout Itemize
\begin_inset Formula
\[
\frac{d\mbox{ rank}\left(E\right)}{dE}=\rho(E)=\sum_{\sigma}\delta(E-E(\sigma))
\]
\end_inset
\end_layout
\begin_layout Itemize
Combining the above expressions and solving gives that
\begin_inset Formula
\[
\log\mbox{ rank}\left(E\right)=E+\log P_{s}\left(E\right)
\]
\end_inset
where
\begin_inset Formula $P_{s}\left(E\right)=e^{-E}n\left(E\right)$
\end_inset
is a smoothed, energy-weighted probability of states.
This relation is exact (i.e.
is independent of Zipf's law).
\end_layout
\begin_layout Itemize
Zipf's law can thus be written as
\begin_inset Formula
\[
P_{s}\left(E\right)=const.
\]
\end_inset
This enables practical calculations on distributions (next section).
\end_layout
\begin_layout Itemize
Equivalently, Zipf's law may be written as
\begin_inset Formula
\[
n\left(E\right)\sim\exp E
\]
\end_inset
That is, the number of states below energy
\begin_inset Formula $E$
\end_inset
is expanding exponentially.
\end_layout
\begin_layout Subsection
Deriving Zipf's Law
\end_layout
\begin_layout Standard
The derivation of Zipf's law from latent variables is given by Schwab
\emph on
etal
\emph default
.
\begin_inset CommandInset citation
LatexCommand cite
key "Schwab2014"
literal "true"
\end_inset
and is summarixed below.
Aitchison
\emph on
etal
\emph default
.
\begin_inset CommandInset citation
LatexCommand cite
key "Aitchison2016"
literal "true"
\end_inset
claim to have a more general proof.
\end_layout
\begin_layout Itemize
A
\begin_inset Quotes eld
\end_inset
latent variable
\begin_inset Quotes erd
\end_inset
\begin_inset Formula $\theta$
\end_inset
(or a set
\begin_inset Formula $\theta_{i}$
\end_inset
of them) are hidden parameters that govern the observed distribution; namely,
that
\begin_inset Formula
\[
p\left(\sigma\right)=\int d\theta\,p\left(\sigma|\theta\right)p\left(\theta\right)
\]
\end_inset
\end_layout
\begin_layout Itemize
Assume that some (maybe all, but at least one) of the order parameters
\begin_inset Formula $\beta_{i}$
\end_inset
is a latent variable
\begin_inset Formula $\theta_{i}$
\end_inset
.
That is, write
\begin_inset Formula $\theta_{i}$
\end_inset
for
\begin_inset Formula $\beta_{i}$
\end_inset
when
\begin_inset Formula $\beta_{i}$
\end_inset
is latent.
\end_layout
\begin_layout Itemize
Resuming the notation from the revious section, if the order parameter has
some distribution
\begin_inset Formula $p\left(\theta\right)$
\end_inset
, then one has a
\begin_inset Quotes eld
\end_inset
mixed state
\begin_inset Quotes erd
\end_inset
and must write
\begin_inset Formula
\[
p\left(\sigma\right)=\int d\theta\,p\left(\theta\right)e^{-N\mathcal{H}\left(\sigma,\beta\right)}
\]
\end_inset
where the integral is over the
\begin_inset Formula $K$
\end_inset
latent parameters:
\begin_inset Formula $\int d\theta=\int d\theta_{1}d\theta{}_{2}\cdots d\theta_{K}$
\end_inset
and
\begin_inset Formula $\mathcal{H}\left(\sigma,\beta\right)=\sum_{i}\beta_{i}H_{i}\left(\sigma\right)+\frac{1}{N}\log Z\left(\beta\right)$
\end_inset
.
\end_layout
\begin_layout Standard
With some mild assumptions, one can approximate the above integral
\end_layout
\begin_layout Itemize
If
\begin_inset Formula $p\left(\theta\right)$
\end_inset
is smooth, if
\begin_inset Formula $p\left(\theta\right)$
\end_inset
does not depend on
\begin_inset Formula $N$
\end_inset
and if
\begin_inset Formula $p\left(\theta\right)$
\end_inset
has non-vanishing support at the saddle point
\begin_inset Formula $\beta^{*}$
\end_inset
, then the above can be approximated using saddle-point methods, giving
\begin_inset Formula
\[
E\left(\sigma\right)=-\frac{1}{N}\log p\left(\sigma\right)=\sum_{i}\beta_{i}^{*}H_{i}\left(\sigma\right)+\frac{1}{N}\log Z\left(\beta^{*}\right)
\]
\end_inset
\end_layout
\begin_layout Itemize
The saddle point
\begin_inset Formula $\beta^{*}$
\end_inset
is the solution to
\begin_inset Formula
\[
\frac{1}{N}\left.\frac{\partial\log Z\left(\beta\right)}{\partial\beta_{i}}\right|_{\beta^{*}}=-H_{i}\left(\sigma\right)
\]
\end_inset
when
\begin_inset Formula $\beta_{i}=\theta_{i}$
\end_inset
is one of the hidden variables, and otherwise is just the overt, non-hidden
value
\begin_inset Formula $\beta_{i}$
\end_inset
.
\end_layout
\begin_layout Itemize
Note that
\begin_inset Formula $\beta^{*}=\beta^{*}\left(\sigma\right)$
\end_inset
that is,
\begin_inset Formula $\beta^{*}$
\end_inset
is a function of
\begin_inset Formula $\sigma$
\end_inset
.
This comes from the right-hand-side, above.
\end_layout
\begin_layout Itemize
The microcanonical entropy is given by
\begin_inset Formula
\[
S\left(\left\{ H_{i}\left(\sigma\right)\right\} \right)=\inf_{\beta}\left[\sum_{i}\beta_{i}H_{i}\left(x\right)+c\left(\beta\right)\right]
\]
\end_inset
\end_layout
\begin_layout Itemize
The
\begin_inset Quotes eld
\end_inset