histogram

fun ReportBuilder.histogram(h: Histogram, caption: String? = null, confidenceLevel: Double = 0.95, showPlot: Boolean = true)(source)

Appends a self-contained section that reports the bin structure, over/underflow summary, bin frequency table, statistics on binned observations, and a histogram plot.

Produces (inside a section titled caption or h.name):

  1. A ksl.utilities.io.report.ast.ReportNode.Paragraph summarising bin count, range, underflow count, overflow count, and total count.

  2. A DataTable ("Bin Frequencies") with columns: Bin | Label | Lower | Upper | Count | Cum Count | % | Cum %

  3. A ksl.utilities.io.report.ast.ReportNode.StatTable ("Statistics on Binned Data") for the observations that fell within the defined bins (excludes over/underflow).

  4. A ksl.utilities.io.report.ast.ReportNode.PlotNode for the histogram plot.

Numeric formatting: bin limits that are ±∞ are rendered as "−∞" / "+∞". Proportions are shown as percentages rounded to two decimal places. All other floating-point values use four decimal places.

Usage:

val doc = report("Wait Time Analysis") {
histogram(waitTimeHistogram, confidenceLevel = 0.90)
}

Parameters

h

the histogram to report

caption

optional section title; defaults to h.name

confidenceLevel

confidence level for the StatTable half-width and CI; must be in (0, 1)

showPlot

when true (default) a histogram bar-chart plot is appended after the frequency table. Set to false when the plot should be omitted — e.g. inside a statistical-summary section where plots live in a separate visualization section.


fun ReportBuilder.histogram(h: HistogramIfc, caption: String? = null, confidenceLevel: Double = 0.95, showPlot: Boolean = true)(source)

Overload of histogram that accepts a HistogramIfc reference.

This is the variant used by SimulationReportExtensions when reporting histograms obtained from a ksl.simulation.Model via ksl.modeling.variable.HistogramResponseCIfc.histogram, which returns ksl.utilities.statistic.CachedHistogram (implements HistogramIfc, not Histogram).

All content is identical to the Histogram overload: overview paragraph, bin frequency table, statistics on binned data, and histogram plot.

Parameters

h

the histogram interface to report

caption

optional section title; defaults to h.name

confidenceLevel

confidence level for the StatTable half-width and CI; must be in (0, 1)

showPlot

when true (default) a histogram bar-chart plot is appended. Set to false to omit the plot (e.g. inside a statistical-summary section).