CMU Artificial Intelligence Repository
Home INFO Search FAQs Repository Root

HIST: Simple histogram facility using Format strings for output.

lang/lisp/code/math/hist/
Hist is a macro of form (HIST (min max [bucket-size]) . body) Creates a histogram with buckets of the specified size (defaults to 1), spanning the range from Low (inclusive) to High (exclusive), with two additional buckets to catch values below and above this range. The body is executed as a progn, and every call to Hist-Record within the body provides a value for the histogram to count. When Body exits, the histogram is printed out and Hist returns NIL. A simple example: (hist (0 10) (dotimes (i 1000) (random 10))) This example may make the RANDOM distribution look more normal: (hist (0 10 2) (dotimes (i 1000) (random 10))) This example will show you overflow buckets: (hist (2 12) (dotimes (i 1000) (random 15)))
Version: 28-JUN-90 Requires: Common Lisp. Ports: Fully portable. Copying: Public domain. CD-ROM: Prime Time Freeware for AI, Issue 1-1 Author(s): Scott E. Fahlman School of Computer Science Carnegie Mellon University 5000 Forbes Avenue Pittsburgh, PA 15213-3891 Keywords: Authors!Fahlman, Histograms, Lisp!Math, Math, Public Domain References: ?
Last Web update on Mon Feb 13 10:30:23 1995
AI.Repository@cs.cmu.edu