From 5e01164a72e8038da38b18d7b9a4d37fb9bde118 Mon Sep 17 00:00:00 2001 From: Benjamin Pollack Date: Fri, 30 Jan 2015 08:20:50 -0500 Subject: [PATCH] Add more documentation for math.statistics --- basis/math/statistics/statistics-docs.factor | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/basis/math/statistics/statistics-docs.factor b/basis/math/statistics/statistics-docs.factor index f6e66793e9..b408acf581 100644 --- a/basis/math/statistics/statistics-docs.factor +++ b/basis/math/statistics/statistics-docs.factor @@ -15,6 +15,11 @@ HELP: harmonic-mean { $examples { $example "USING: math.statistics prettyprint ;" "{ 1 2 3 } harmonic-mean ." "6/11" } } { $errors "Throws a " { $link signal-error. } " (divide by zero) if the sequence is empty." } ; +HELP: kth-smallest +{ $values { "seq" sequence } { "k" integer } } +{ $description "Returns the kth smallest element. This is semantically equivalent to " { $snippet "swap natural-sort nth" } ", and is therefore zero-indexed. " { $snippet "k" } " may not be larger than the highest index of " { $snippet "sequence" } "." } +{ $examples { $example "USING: math.statistics ;" "{ 3 1 2 } 1 kth-smallest ." "2" } } ; + HELP: mean { $values { "seq" sequence } { "x" "a non-negative real number"} } { $description "Computes the arithmetic mean of the elements in " { $snippet "seq" } "." }