Liking cljdoc? Tell your friends :D

criterium.viewer.common-charts.distribution

Distribution overlay functions for Vega-Lite charts.

Provides KDE, PDF, and CDF visualization layers and complete chart specs for displaying distribution fits and comparing empirical vs theoretical distributions.

Distribution overlay functions for Vega-Lite charts.

Provides KDE, PDF, and CDF visualization layers and complete chart specs
for displaying distribution fits and comparing empirical vs theoretical
distributions.
raw docstring

distribution-cdf-layerclj

(distribution-cdf-layer dist fit-result grid transforms)

Build a CDF curve layer for a single fitted distribution.

Takes the distribution keyword, fit result, x-values grid, and transforms. Returns a Vega-Lite layer spec or nil if the distribution couldn't be fitted.

Build a CDF curve layer for a single fitted distribution.

Takes the distribution keyword, fit result, x-values grid, and transforms.
Returns a Vega-Lite layer spec or nil if the distribution couldn't be fitted.
sourceraw docstring

distribution-cdf-overlay-layersclj

(distribution-cdf-overlay-layers fit-data grid transforms)

Build CDF overlay layers for all fitted distributions.

Takes distribution-fit data for a metric, x-values grid, and transforms. Returns a vector of Vega-Lite layer specs for successfully fitted distributions.

Build CDF overlay layers for all fitted distributions.

Takes distribution-fit data for a metric, x-values grid, and
transforms.  Returns a vector of Vega-Lite layer specs for
successfully fitted distributions.
sourceraw docstring

distribution-cdf-vega-specclj

(distribution-cdf-vega-spec data-map view chart-options)

Build a complete Vega-Lite spec for ECDF with distribution CDF overlays.

Takes data-map, view options, and chart-options map containing :width and/or :height for chart dimensions.

View options: :samples-id - Key for samples data in data-map (default :samples) :distribution-fit-id - Key for distribution fit data (default :distribution-fit)

The x-axis range is derived from the sample data. Fitted CDFs are overlaid on the empirical CDF for visual comparison of goodness-of-fit.

Returns the Vega-Lite spec without viewer-specific wrapping.

Build a complete Vega-Lite spec for ECDF with distribution CDF overlays.

Takes data-map, view options, and chart-options map containing :width and/or
:height for chart dimensions.

View options:
  :samples-id - Key for samples data in data-map (default :samples)
  :distribution-fit-id - Key for distribution fit data
                         (default :distribution-fit)

The x-axis range is derived from the sample data. Fitted CDFs are overlaid
on the empirical CDF for visual comparison of goodness-of-fit.

Returns the Vega-Lite spec without viewer-specific wrapping.
sourceraw docstring

distribution-color-scaleclj

Vega-Lite color scale with domain and range in consistent order.

Vega-Lite color scale with domain and range in consistent order.
sourceraw docstring

distribution-colorsclj

Color palette for fitted distributions. Colors chosen to avoid conflict with histogram blue (#4682b4 steelblue).

Color palette for fitted distributions.
Colors chosen to avoid conflict with histogram blue (#4682b4 steelblue).
sourceraw docstring

distribution-labelsclj

Human-readable labels for distributions. Re-exported from common.distribution for backwards compatibility.

Human-readable labels for distributions.
Re-exported from common.distribution for backwards compatibility.
sourceraw docstring

distribution-orderclj

Canonical ordering of distributions for consistent color assignment.

Canonical ordering of distributions for consistent color assignment.
sourceraw docstring

distribution-pdf-layerclj

(distribution-pdf-layer dist
                        fit-result
                        grid
                        field-name
                        transforms
                        scale-by-jacobian?)

Build a PDF curve layer for a single fitted distribution.

Takes the distribution keyword, fit result, grid (in original units), field-name, transforms, scale-by-jacobian? flag, and show-legend? flag.

The grid should be in original sample units. The field-name should match the KDE layer's x-field for proper axis sharing. The transforms are applied to x-values for display alignment with the KDE (which may include batch normalization).

When scale-by-jacobian? is true, the PDF is multiplied by x to convert from density-per-original-unit to density-per-log-unit (for overlay on log-transformed KDE).

Returns a Vega-Lite layer spec or nil if the distribution couldn't be fitted.

Build a PDF curve layer for a single fitted distribution.

Takes the distribution keyword, fit result, grid (in original units),
field-name, transforms, scale-by-jacobian? flag, and show-legend?
flag.

The grid should be in original sample units. The field-name should
match the KDE layer's x-field for proper axis sharing. The transforms
are applied to x-values for display alignment with the KDE (which may
include batch normalization).

When scale-by-jacobian? is true, the PDF is multiplied by x to convert
from density-per-original-unit to density-per-log-unit (for overlay on
log-transformed KDE).

Returns a Vega-Lite layer spec or nil if the distribution couldn't be fitted.
sourceraw docstring

distribution-pdf-overlay-layersclj

(distribution-pdf-overlay-layers fit-data
                                 grid
                                 field-name
                                 transforms
                                 scale-by-jacobian?)

Build PDF overlay layers for all fitted distributions.

Takes distribution-fit data for a metric, grid (in original units), field-name, transforms, and scale-by-jacobian? flag. When scale-by-jacobian? is true, PDFs are scaled by x to convert to density-per-log-unit for overlay on log-transformed KDE. The transforms are applied to x-values for display alignment with the KDE.

Returns a vector of Vega-Lite layer specs for successfully fitted distributions.

Build PDF overlay layers for all fitted distributions.

Takes distribution-fit data for a metric, grid (in original units),
field-name, transforms, and scale-by-jacobian? flag. When
scale-by-jacobian? is true, PDFs are scaled by x to convert to
density-per-log-unit for overlay on log-transformed KDE.  The
transforms are applied to x-values for display alignment with the KDE.

Returns a vector of Vega-Lite layer specs for successfully fitted
distributions.
sourceraw docstring

distribution-pdf-vega-specclj

(distribution-pdf-vega-spec data-map view chart-options)

Build a complete Vega-Lite spec for KDE with distribution PDF overlays.

Takes data-map, view options, and chart-options map containing :width and/or :height for chart dimensions.

View options: :kde-id - Key for KDE data in data-map (default :kde) :distribution-fit-id - Key for distribution fit data (default :distribution-fit) :histogram-id - Optional key for histogram data to overlay

Note: The distribution fit is done on original samples (not log-transformed). The PDF grid is generated to match the KDE display range, constrained by the sample data range. PDF values are scaled by the Jacobian when the KDE is on log-transformed data.

Returns the Vega-Lite spec without viewer-specific wrapping.

Build a complete Vega-Lite spec for KDE with distribution PDF overlays.

Takes data-map, view options, and chart-options map containing :width and/or
:height for chart dimensions.

View options:
  :kde-id - Key for KDE data in data-map (default :kde)
  :distribution-fit-id - Key for distribution fit data
                         (default :distribution-fit)
  :histogram-id - Optional key for histogram data to overlay

Note: The distribution fit is done on original samples (not log-transformed).
The PDF grid is generated to match the KDE display range, constrained by
the sample data range. PDF values are scaled by the Jacobian when the
KDE is on log-transformed data.

Returns the Vega-Lite spec without viewer-specific wrapping.
sourceraw docstring

ecdf-layerclj

(ecdf-layer samples transforms)

Build an ECDF (empirical cumulative distribution function) step layer.

Takes samples and transforms, returns a Vega-Lite layer spec showing the empirical CDF as a step function.

Build an ECDF (empirical cumulative distribution function) step layer.

Takes samples and transforms, returns a Vega-Lite layer spec showing
the empirical CDF as a step function.
sourceraw docstring

kde-confidence-band-layerclj

(kde-confidence-band-layer kde-data metric-config transforms)

Build a confidence band area layer for KDE visualization. Uses 'kde-lower'/'kde-upper' fields to avoid Y-scale conflicts. Returns a Vega-Lite layer spec.

Build a confidence band area layer for KDE visualization.
Uses 'kde-lower'/'kde-upper' fields to avoid Y-scale conflicts.
Returns a Vega-Lite layer spec.
sourceraw docstring

kde-density-layerclj

(kde-density-layer kde-data metric-config transforms)

Build a density curve layer for KDE visualization. Uses 'kde-density' field for independent Y-scale from histogram. Returns a Vega-Lite layer spec.

Build a density curve layer for KDE visualization.
Uses 'kde-density' field for independent Y-scale from histogram.
Returns a Vega-Lite layer spec.
sourceraw docstring

kde-modes-layerclj

(kde-modes-layer modes-data metric-config transforms)

Build mode marker layers for KDE visualization. Takes modes-data from separate modes analysis (not from kde-data). Uses 'kde-density' field to match KDE curve scale. Uses shape (not color) for significance to avoid color scale conflicts. Returns a vector of Vega-Lite layer specs (point markers and CI rules).

Build mode marker layers for KDE visualization.
Takes modes-data from separate modes analysis (not from kde-data).
Uses 'kde-density' field to match KDE curve scale.
Uses shape (not color) for significance to avoid color scale conflicts.
Returns a vector of Vega-Lite layer specs (point markers and CI rules).
sourceraw docstring

kde-vega-specclj

(kde-vega-spec data-map view chart-options)

Build a complete Vega-Lite spec for KDE visualization.

Takes data-map, view options, and chart-options map containing :width and/or :height for chart dimensions.

View options: :kde-id - Key for KDE data in data-map (default :kde) :histogram-id - Optional key for histogram data to overlay :modes-id - Optional key for modes data (default :modes)

Returns the Vega-Lite spec without viewer-specific wrapping.

Build a complete Vega-Lite spec for KDE visualization.

Takes data-map, view options, and chart-options map containing :width and/or
:height for chart dimensions.

View options:
  :kde-id - Key for KDE data in data-map (default :kde)
  :histogram-id - Optional key for histogram data to overlay
  :modes-id - Optional key for modes data (default :modes)

Returns the Vega-Lite spec without viewer-specific wrapping.
sourceraw docstring

make-quantile-fnclj

(make-quantile-fn dist params)

Create a quantile (inverse CDF) function for the given distribution . Used by Q-Q plot generation to compute theoretical quantiles.

Create a quantile (inverse CDF) function for the given distribution .
Used by Q-Q plot generation to compute theoretical quantiles.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close