Charts for statistics
The pictures phase of the statistics package: box plots, histograms with a density over them, density curves with a certified shaded probability, quantile plots, fitted lines with bands, power curves, and a sampling distribution building up.
Box plots by Tukey's hinges
fiveNumbers(values) sorts the data and takes the median of each half (the middle value in both halves when is odd). With and the hinges and , the whiskers reach the furthest data inside and the rest are drawn as outliers. boxPlot({ name: values, … }) sets the boxes side by side.
Histograms and densities
histogramFigure(values, { bins, distribution }) draws the counts, or with a distribution the density scale (total area 1) with the curve over it. densityFigure(dist, { shade: [a, b] }) draws the density from the distribution's fast float version and shades . The curve is estimated; the probability in the notes is the distribution's own prob(a, b), which in @ratmath/stats is a certified interval.
Quantile plots
qqPlot(values, dist) sets the -th smallest value against the distribution's quantile at . Data from that family, after a shift and a scale, fall along a line; the line drawn is the one through the quartiles. A bend at the ends means heavier or lighter tails.
Fits, power and sampling
scatterFit(points, { fit, band }) takes a line as { intercept, slope } or a regression's coefficients, and a band as a function . powerCurve draws the chance a test rejects against the true effect, with the level as a dashed line. samplingBuildUp(values, { steps }) gives frames of a histogram of the first values on shared bins and scales, marked simulated: animate them to watch the shape settle.
@ratmath/graphics and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math, and SHOW(svg) draws a picture.