Entropy and complexity¶
These examples compare normalized LZ76 entropy density h and effective measure complexity E for binary sequences with different temporal dependencies.
h and E for six binary sequences¶
All six inputs have 8192 binary observations. E uses a fixed cap of 6. The persistent process changes state with probability 0.08 at each step; the independent sample draws fair binary values. These labels describe the data construction, not estimator guarantees.
import numpy as np
import lzsuite as lzs
periodic = np.tile([0, 0, 0, 1, 0, 1, 1, 1], 1024)
independent = np.random.default_rng(1729).integers(0, 2, size=8192)
for sequence in [periodic, independent]:
result = lzs.lz76(sequence, max_block_size=6)
print(result["h"], result["emc"]["value"])
Fitted profiles and increments¶
The profile is fitted jointly. Its increments are nonnegative and sum to the score, but they are not separate, independent estimates of each scale's contribution. Use the actual cap and selected estimator when interpreting them.
Estimator comparison¶
chao, _ = lzs.emc(periodic, method="chao-shen", max_block_size=6)
shuffle, _ = lzs.emc(periodic, method="shuffle", max_block_size=6)
The estimators use different raw profiles. This chart is a comparison of their operational outputs, not evidence that one is universally more accurate. See the E guide for the formulas and range policies.
Sequence-length dependence¶
Short estimates can exceed one. The curves use overlapping prefixes, not independent realizations, and the dotted source-rate reference is not an exact finite-sample target. Repeated recordings or suitable ensembles are needed to assess sampling variation.