state Frequency
Appends a self-contained section that reports the state frequency distribution, summary statistics on the observed state numbers, optional transition matrices, and a frequency bar plot.
Produces (inside a section titled caption or freq.name):
A ksl.utilities.io.report.ast.ReportNode.Paragraph summarising total observations and number of states.
A
DataTable("State Frequency Table") with columns: State | Count | Cum Count | % | Cum %A ksl.utilities.io.report.ast.ReportNode.StatPropertyTable ("Statistics on Observed States") built from StateFrequency.statistic — the explicit bridge to numeric statistics on state numbers. Omitted when
showStatisticsisfalse.A
DataTable("Transition Count Matrix") — square matrix of state-to-state transition counts, rows = from-state, columns = to-state. Omitted whenshowTransitionsisfalse.A
DataTable("Transition Proportion Matrix") — same structure as the count matrix but with row-normalised proportions (each row sums to 1.0 for visited states, 0.0 for unvisited states). Omitted whenshowTransitionProportionsisfalse.A ksl.utilities.io.report.ast.ReportNode.PlotNode for the state frequency bar chart. Omitted when
showPlotisfalse.
Usage:
val doc = report("Machine State Analysis") {
stateFrequency(machineStateFreq, showTransitionProportions = true)
}Parameters
the state frequency tabulation to report
optional section title; defaults to freq.name
confidence level for the StatPropertyTable CI; must be in (0, 1)
when true (default) a StatPropertyTable of numeric statistics on observed state numbers is included. Set to false when the numeric statistics on state numbers have no meaningful interpretation.
when true (default) a transition count matrix DataTable is included
when true a transition proportion matrix DataTable is included (row-normalised: each row sums to 1.0 for visited states). Default is false.
when true (default) a frequency bar chart is appended
when true the bar chart y-axis shows proportions; when false (default) it shows counts. Has no effect when showPlot is false.