Documentation
¶
Overview ¶
Package report writes a run's summary as a table, JSON or CSV from the typed values, by hand. The CLI, the browser build and the language bindings all produce their output through it, so the JSON shape is one and the same everywhere.
Index ¶
- func BoundsAt(b variate.Bounds, x float64) (lo, hi float64)
- func CSVField(s string) string
- func PlanJSON(w *bufio.Writer, c *variate.Compiled, e *variate.Expectation, ...)
- type BlockFigure
- type Histogram
- func LinearHistogram(w *variate.Workspace, top float64, n int, unit float64) *Histogram
- func LinearHistogramOf(w *variate.Workspace, row int, top float64, n int, unit float64) *Histogram
- func LogHistogram(w *variate.Workspace, lo, top float64, n int) *Histogram
- func LogHistogramOf(w *variate.Workspace, row int, lo, top float64, n int) *Histogram
- type Report
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoundsAt ¶
BoundsAt reads a transform bracket at x from the lattice point at or above x, for both curves: a total of at least x rounds up to at least that point, and a total that rounds down to at least that point is at least x. Below the first point the upper bound is then the probability of a non-empty period, not one.
func PlanJSON ¶
func PlanJSON(w *bufio.Writer, c *variate.Compiled, e *variate.Expectation, cfg variate.Config, warnings []variate.Warning, estimate string, blocks []BlockFigure)
PlanJSON writes the convergence plan as JSON: the expected work, the exact mean, the warnings, the criteria rows, the periods the plan runs and what binds them, an estimate of the time, and the blocks.
Types ¶
type BlockFigure ¶
type BlockFigure struct {
Source string
}
BlockFigure is a reliability block's stationary figures, for the plan.
type Histogram ¶
Histogram is a band chart of the period total: the mass between consecutive edges, with the mass beyond the last edge as a final band.
func LinearHistogram ¶
LinearHistogram builds a histogram of n bands from 0 to top from the workspace's streaming histogram, plus the open band beyond top. The empty periods are in no band: they are reported as a share of their own, and in a rare-event model they would dwarf every other band. A positive unit says the total is a multiple of it; the bands are then the same whole number of multiples each, with edges halfway between multiples, so a chart of a lattice does not ripple with the number of atoms a band happens to catch.
func LinearHistogramOf ¶
LinearHistogramOf is LinearHistogram for the quantity at a row of the workspace (Workspace.QuantityRow).
func LogHistogram ¶
LogHistogram builds a histogram of n bands with edges spaced equally in the logarithm from lo to top, plus the open band beyond top, from the workspace's streaming histogram. Leading bands with less than minMass are dropped, so the chart starts where the mass does. Periods with a total below lo, including the empty ones, are in no band.
type Report ¶
type Report struct {
C *variate.Compiled
R *variate.Result
Sum *variate.Summary
Analytic bool // include the exact expectations and the transform
E *variate.Expectation
Tr *variate.Transformed
Hist *Histogram // linear bands of the period total, for drawing; nil = none
LogHist *Histogram // log-spaced bands of the same, for drawing; nil = none
Warnings []variate.Warning // compile warnings to include in the JSON
}
Report is everything the summary writers read.
func New ¶
func New(c *variate.Compiled, w *variate.Workspace, r *variate.Result, analytic bool) (*Report, error)
New assembles the report of a finished run from its workspace: the summary, and with analytic the exact expectations and the transform computed at compile. Every entry point builds its report here.
func (*Report) WriteExceedanceFile ¶
WriteExceedanceFile writes the curve as CSV: x, p, stderr, and the transform's lower and upper bounds when they exist.
func (*Report) WriteTable ¶
WriteTable writes the human-readable report.