News for hackers. Stuff that matters.
Re:Kullback–Leibler Divergence by eutectic on Tuesday August 22, 2023 @07:16PM (#37229841)
Negative log is the only decreasing function which satisfies f(x * y) = f(x) + f(y). If you have two independent events it makes sense that the total surprisal (information content) should be the sum of the surprisals of the two events.

Another way to see it is as a continuous generalization of the idea that you need n bits to represent 2^n equally likely alternatives.

Re:Kullback–Leibler Divergence by sarma17 on Tuesday August 22, 2023 @07:25PM (#37229905)
thanks for the reply but I don't think I understood what you said in the context of my question.

I'm stuck on why we care about surprisal as `log 1/p`.

Re:Kullback–Leibler Divergence by eutectic on Tuesday August 22, 2023 @07:25PM (#37229907)
log 1/p is just -log p
Re:Kullback–Leibler Divergence by sixo on Saturday September 02, 2023 @10:08PM (#37367110)
I think "information" is a better name than surprisal.

If your distribution has N equally-likely values, `p(x) = 1/N`, and information/surprisal `I(x) = log(N)`. In base 2, this is how many bits are required to specify exactly WHICH of the N values you're talking about.

If `x` is not a single one of the N states but an event consisting of `n(x)` states, then `I(x) = log(N) - log(n(x))`, suggesting it takes _somewhat less information_ to specify this particular state, and it correctly gives 0 if `n(x) = N`, i.e. there's only one state.

Exactly what this "less information" means is vague, but you might think of it in terms of compression: if you compress some stream of data which is sampled from `X` with probability `p(x)`, you could use use the shortest codes (0, 10, 11, etc) for the most common values with some "stop word" to say when the end of a datum is reached. `I(x)` captures this sense in general, but it might only become literally true in the limit of a very large stream of data with a very large dictionary.

Re:Kullback–Leibler Divergence by ramblenode on Tuesday August 22, 2023 @08:30PM (#37230414)
> If you have two independent events it makes sense that the total surprisal (information content) should be the sum of the surprisals of the two events.

I think the parent is also asking why we would expect surprisal to be additive rather than multiplicative like probabilities.

Re:Kullback–Leibler Divergence by Majromax on Tuesday August 22, 2023 @09:04PM (#37230649)
Because if two things happen – one totally expected and one very surprising – then on net you’re still surprised.
Re:Kullback–Leibler Divergence by ramblenode on Wednesday August 23, 2023 @12:37PM (#37238641)
That's also the case for probabilities.
Re:Kullback–Leibler Divergence by joelthelion on Wednesday August 23, 2023 @04:36AM (#37233311)
I think in part because it's really nice to measure information in bits rather than tiny probabilities. And it aligns well with how information is stored.
Re:Kullback–Leibler Divergence by KRAKRISMOTT on Tuesday August 22, 2023 @10:25PM (#37231192)
Convolution?
Re:Kullback–Leibler Divergence by beyondCritics on Thursday August 24, 2023 @11:53AM (#37250345)
> Negative log is the only decreasing function which satisfies f(x * y) = f(x) + f(y)

Times a constant!