Definition:
Sample Entropy:
- Measures impurity of a sample
- H(X)=−∑i P(X=i)∗log2(P(X=i))
- 0≤H(X)≤log2(N)
- the number of expected bits needed to encode a randomly drawn value of X (under most efficient code)
- −log2(P(X=i)) represents the number of bits needed to encode the event “X=i” if it were a binary event. \
- For example, if the probability is 1/4, then log2(1/4)=−2, implying that 2 bits are needed to encode this event.
- P(X=i)∗log2(P(X=i)) calculates the expected number of bits needed to encode the event “X=i”.
- Sums up the expected number of bits for all possible values of X
Conditional Entropy:
- Of a variable Y conditioned on a random variable X
- H(Y∣X)=−∑j=1n[P(X=j)∑i=1mP(Y=i∣X=j)log2P(Y=i∣X=j)]
- H(Y∣X)=∑jmP(X=j)H(Y∣X=j)
- H(Y∣X=j)=−∑jmP(Y=i∣X=j)log2P(Y=i∣X=j) by def
- Decrease in entropy (less random) after knowing X
- IG(X)=H(Y)−H(Y∣X)