Module:Infobox ET: Difference between revisions

R-4981 (talk | contribs)
No edit summary
R-4981 (talk | contribs)
No edit summary
Line 203: Line 203:
end
end
harmonic_entropy = 0
local harmonic_entropy = 0
local harmonic_entropy_min = 1000
for i=1, math.floor(et.size) do
for i=1, math.floor(et.size) do
harmonic_entropy = harmonic_entropy + interval_extension.harmonic_entropy_with_lookup_table(step_size * i)
he = interval_extension.harmonic_entropy_with_lookup_table(step_size * i)
harmonic_entropy = harmonic_entropy + he
if he <= harmonic_entropy_min then harmonic_entropy_min = he end
end
end
harmonic_entropy = harmonic_entropy / et.size
harmonic_entropy = harmonic_entropy / et.size
Line 211: Line 214:
table.insert(infobox_data, {
table.insert(infobox_data, {
"[[Harmonic entropy]]<br/>(Shannon, √nd)",
"[[Harmonic entropy]]<br/>(Shannon, √nd)",
"~" .. utils._round(harmonic_entropy, 6) .. " nats",
"~" .. utils._round(harmonic_entropy, 6) .. " nats (average)<br/>~" .. utils._round(harmonic_entropy_min, 6) .. "nats (min)",
})
})