Week 06 · Sufficiency and Fisher information
Reduce Bernoulli data to a count and measure local precision.
← Week 5 · Subject contents · Week 7 →
Reduce Bernoulli data to a count and measure local precision.
Work through the problem
For independent Bernoulli observations, the likelihood factors through k = ΣXᵢ. Two sequences with the same k and n have identical likelihoods. That factorization makes k sufficient for p under this model. A timestamp order would matter in a model where p changes over time.
Fisher information is minus the expected second derivative of the log likelihood. Since E[k] = np, Iₙ(p) = np/p² + n(1−p)/(1−p)² = n/[p(1−p)]. At p = 0.5, n = 10 gives 40 units of information and n = 40 gives 160. Dividing by four in variance corresponds to halving standard error.
Run the Python lab
import numpy as np
a = np.array([1, 0, 1, 0])
b = np.array([0, 1, 0, 1])
p = .3
for row in [a, b]:
print(round(np.prod(np.where(row == 1, p, 1-p)), 4))
for n in [10, 40]:
information = n / (.5 * .5)
print(n, information, round(1 / np.sqrt(information), 3))
assert a.sum() == b.sum() == 2
Output from the lab
0.0441
0.0441
10 40.0 0.158
40 160.0 0.079
Practice
- Under an independent Bernoulli model, can rearranging the observations change p̂?
Check your reasoning
- No. Rearranging preserves k and n.