Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
statistex property
check all samples <- list_of(float(), min_length: 1) do
stats = statistics(samples)
assert stats.sample_size >= 1
assert stats.minimum <= stats.maximum
assert stats.minimum <= stats.average
assert stats.average <= stats.maximum
assert stats.minimum <= stats.median
assert stats.median <= stats.maximum
assert stats.median == stats.percentiles[50]
assert stats.standard_deviation >= 0
assert stats.standard_deviation_ratio >= 0
# property that mode occurs in the sample omitted for brevity
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment