Skip to content

Commit 0fa92ed

Browse files
authored
Merge pull request #206 from Morrison-Lab/claude/rarity-before-surprisal
Define rarity before surprisal; subscript conditional-entropy expectations
2 parents 45a6d68 + 212c164 commit 0fa92ed

20 files changed

Lines changed: 122 additions & 73 deletions

‎_subfiles/_cor-surprisal-discrete-nonnegative.qmd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ the [rarity](#def-rarity) $\rarityf{x} = 1 / \P(X=x)$ is at least $1$,
1818
with equality exactly when $\P(X=x) = 1$.
1919
The [logarithm](https://morrison-lab.github.io/mds/algebra-exponentials.html#def-logarithm) is increasing,
2020
and $\logf{1} = 0$,
21-
so by @thm-surprisal-log-rarity,
21+
so by the definition of [surprisal](#def-surprisal),
2222
$\surprisalf{x} = \logf{\rarityf{x}} \ge 0$.
2323

2424
:::

‎_subfiles/_def-bit.qmd‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ for a value $x$ of a [discrete random variable](https://morrison-lab.github.io/p
1111
$$
1212
\begin{aligned}
1313
\surprisalf{x} = 1 \text{ bit}
14-
&\iff -\log_2 \P(X=x) = 1\\
15-
&\iff \P(X=x) = 2^{-1} = \tfrac{1}{2}.
14+
&\iff \log_2 \rarityf{x} = 1\\
15+
&\iff \rarityf{x} = 2\\
16+
&\iff \P(X=x) = \tfrac{1}{2}.
1617
\end{aligned}
1718
$$ {#eq-bit}
1819

‎_subfiles/_def-conditional-entropy.qmd‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
For $X$ and $Y$ as in @def-joint-surprisal,
55
the **conditional entropy** of $Y$ given $X$
6-
is the [expectation](https://morrison-lab.github.io/pds/expectation.html#def-expectation) of the [conditional surprisal](#def-conditional-surprisal) of $Y$ given $X$:
6+
is the [expectation](https://morrison-lab.github.io/pds/expectation.html#def-expectation),
7+
over the [joint distribution](https://morrison-lab.github.io/pds/random-variables.html#def-joint-distribution) of $X$ and $Y$,
8+
of the [conditional surprisal](#def-conditional-surprisal) of $Y$ given $X$:
79

8-
$$\entropyf{Y \mid X} \eqdef \E{\surprisalf{Y \mid X}}.$$ {#eq-conditional-entropy}
10+
$$\entropyf{Y \mid X} \eqdef \Expfc{X, Y}{\surprisalf{Y \mid X}}.$$ {#eq-conditional-entropy}
911

1012
:::

‎_subfiles/_def-entropy-given-value.qmd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ the **entropy of $Y$ given $X=x$**, for a value $x$ with $\P(X=x) > 0$, is
66
the [expectation](https://morrison-lab.github.io/pds/expectation.html#def-expectation) given $X=x$
77
of $\surprisalf{Y \mid x}$, the [conditional surprisal](#def-conditional-surprisal) of $Y$ given $x$:
88

9-
$$\entropyf{Y \mid X=x} \eqdef \condE{\surprisalf{Y \mid x}}{X=x}.$$ {#eq-entropy-given-value}
9+
$$\entropyf{Y \mid X=x} \eqdef \Expfc{Y \mid X=x}{\surprisalf{Y \mid x} \given X=x}.$$ {#eq-entropy-given-value}
1010

1111
:::

‎_subfiles/_def-joint-entropy.qmd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
For $X$ and $Y$ as in @def-joint-surprisal,
55
their **joint entropy** is the [expectation](https://morrison-lab.github.io/pds/expectation.html#def-expectation) of their [joint surprisal](#def-joint-surprisal):
66

7-
$$\entropyf{X, Y} \eqdef \E{\surprisalf{X, Y}}.$$ {#eq-joint-entropy}
7+
$$\entropyf{X, Y} \eqdef \Expfc{X, Y}{\surprisalf{X, Y}}.$$ {#eq-joint-entropy}
88

99
:::

‎_subfiles/_def-mutual-information.qmd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
The **mutual information** between
55
[discrete random variables](https://morrison-lab.github.io/pds/random-variables.html#def-discrete-rv) $X$ and $Y$
66
with finite [entropies](https://morrison-lab.github.io/pds/expectation.html#def-entropy)
7-
is the sum of their entropies
7+
is the sum of their [marginal](https://morrison-lab.github.io/pds/random-variables.html#def-marginal) entropies
88
minus their [joint entropy](#def-joint-entropy):
99

1010
$$\mutinfof{X}{Y} \eqdef \entropyf{X} + \entropyf{Y} - \entropyf{X, Y}.$$ {#eq-mutual-information}

‎_subfiles/_def-surprisal.qmd‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
#### Surprisal
33

44
The **surprisal** of a [value](https://morrison-lab.github.io/pds/random-variables.html#def-realization) $x$ of a [discrete random variable](https://morrison-lab.github.io/pds/random-variables.html#def-discrete-rv) $X$
5-
with $\P(X=x) > 0$ is
5+
with $\P(X=x) > 0$ is the [logarithm](https://morrison-lab.github.io/mds/algebra-exponentials.html#def-logarithm) of its [rarity](#def-rarity):
66

7-
$$\surprisalf{x} \eqdef -\log \P(X=x).$$ {#eq-surprisal}
7+
$$\surprisalf{x} \eqdef \logf{\rarityf{x}}.$$ {#eq-surprisal}
88

9-
With base-2 [logarithms](https://morrison-lab.github.io/mds/algebra-exponentials.html#def-logarithm), surprisal is also called the
9+
With base-2 logarithms, surprisal is also called the
1010
**Shannon information content** of the value $x$
1111
[@mackay2003information, section 2.4].
1212

‎_subfiles/_exm-surprisal-coins.qmd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ k
1818
\end{aligned}
1919
$$ {#eq-surprisal-coins}
2020
21-
which is the [surprisal](#def-surprisal) of any one of them, in [bits](#def-bit).
21+
which is the [surprisal](#def-surprisal) of any one of them, in [bits](#def-bit) (@thm-surprisal-neg-log-prob).
2222
2323
Ten tosses that all land heads have probability $2^{-10}$, so
2424

‎_subfiles/_exm-surprisal-rarity-four.qmd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ surprisal_four
1212
```
1313

1414
It has [rarity](#def-rarity) $`r rarity_four`$ by definition.
15-
By @thm-surprisal-log-rarity, its [surprisal](#def-surprisal) is the base-2 [logarithm](https://morrison-lab.github.io/mds/algebra-exponentials.html#def-logarithm) of that rarity, $`r surprisal_four`$ [bits](#def-bit).
15+
By definition, its [surprisal](#def-surprisal) is the base-2 [logarithm](https://morrison-lab.github.io/mds/algebra-exponentials.html#def-logarithm) of that rarity, $`r surprisal_four`$ [bits](#def-bit).
1616

1717
<!-- no-figure: a single closed-form value -->
1818

‎_subfiles/_rem-entropy-chain-rule-from-surprisal.qmd‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ by @def-joint-entropy, @rem-entropy-expected-surprisal and @def-conditional-entr
88

99
$$
1010
\begin{aligned}
11-
\entropyf{X, Y} &= \E{\surprisalf{X, Y}} \\
12-
\entropyf{X} &= \E{\surprisalf{X}} \\
13-
\entropyf{Y \mid X} &= \E{\surprisalf{Y \mid X}}.
11+
\entropyf{X, Y} &= \Expfc{X, Y}{\surprisalf{X, Y}} \\
12+
\entropyf{X} &= \Expfc{X}{\surprisalf{X}} \\
13+
\entropyf{Y \mid X} &= \Expfc{X, Y}{\surprisalf{Y \mid X}}.
1414
\end{aligned}
1515
$$ {#eq-entropy-chain-rule-from-surprisal}
1616

0 commit comments

Comments
 (0)