Module:Infobox ET: Difference between revisions

R-4981 (talk | contribs)
No edit summary
R-4981 (talk | contribs)
No edit summary
Line 206: Line 206:
local harmonic_entropy_min = 1000
local harmonic_entropy_min = 1000
local harmonic_entropy_list = {}
local harmonic_entropy_list = {}
local l = 0
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_r = harmonic_entropy_r + he / (math.floor(et.size)-1)
harmonic_entropy_r = harmonic_entropy_r + he
if he <= harmonic_entropy_min then harmonic_entropy_min = he end
if he <= harmonic_entropy_min then harmonic_entropy_min = he end
table.insert(harmonic_entropy_list, he)
table.insert(harmonic_entropy_list, he)
l = l + 1
end
end
harmonic_entropy_r = harmonic_entropy_r / l
table.sort(harmonic_entropy_list)
table.sort(harmonic_entropy_list)
local harmonic_entropy_median = harmonic_entropy_list[math.floor((et.size-2)/2)]
local harmonic_entropy_median = harmonic_entropy_list[math.floor((et.size-2)/2)]
Line 218: Line 221:
end
end
if et.size <= 2 then
if et.size <= 2 then
harmonic_entropy = 0
harmonic_entropy_r = 0
harmonic_entropy_median = 0
harmonic_entropy_median = 0
harmonic_entropy_min = 0
harmonic_entropy_min = 0