Module:Infobox ET: Difference between revisions
No edit summary |
No edit summary |
||
| Line 205: | Line 205: | ||
local harmonic_entropy = 0 | local harmonic_entropy = 0 | ||
local harmonic_entropy_min = 1000 | local harmonic_entropy_min = 1000 | ||
for i=1, math.floor(et.size)-1 do | for i=1, math.floor(et.size)-1 do | ||
he = 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 | harmonic_entropy = harmonic_entropy + he | ||
if he <= harmonic_entropy_min then harmonic_entropy_min = he end | if he <= harmonic_entropy_min then harmonic_entropy_min = he end | ||
end | end | ||
harmonic_entropy = harmonic_entropy / (et.size-2) | harmonic_entropy = harmonic_entropy / (et.size-2) | ||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
" | "[[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)", | ||
}) | }) | ||