Skip to content

Instantly share code, notes, and snippets.

@fieldAbyss
Last active August 10, 2018 07:18
Show Gist options
  • Save fieldAbyss/c3bf425cfe2e349e863f43fbec99ad00 to your computer and use it in GitHub Desktop.
Save fieldAbyss/c3bf425cfe2e349e863f43fbec99ad00 to your computer and use it in GitHub Desktop.
# RCI
ord(seq, idx, itv) =>
p = seq[idx]
o = 1
for i = 0 to itv - 1
if p < seq[i]
o := o + 1
o
d(itv) =>
sum = 0.0
for i = 0 to itv - 1
sum := sum + pow((i + 1) - ord(src, i, itv), 2)
sum
rci(itv) => (1.0 - 6.0 * d(itv) / (itv * (itv * itv - 1.0))) * 100.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment