Liking cljdoc? Tell your friends :D

criterium.viewer.common-charts.tail-ascii

ASCII chart rendering for tail analysis visualization.

Provides ASCII chart functions for:

  • Tail ratios bar chart
  • Hill plot (tail index estimates vs k)
  • MRL plot (mean residual life vs threshold)
  • Zipf plot (complementary CDF on log-log scale)
  • Exponential Q-Q plot
  • GPD Q-Q plot

These functions are used by :print and :pprint viewers for terminal-based visualization of tail analysis results.

ASCII chart rendering for tail analysis visualization.

Provides ASCII chart functions for:
- Tail ratios bar chart
- Hill plot (tail index estimates vs k)
- MRL plot (mean residual life vs threshold)
- Zipf plot (complementary CDF on log-log scale)
- Exponential Q-Q plot
- GPD Q-Q plot

These functions are used by :print and :pprint viewers for terminal-based
visualization of tail analysis results.
raw docstring

render-ascii-exponential-qqclj

(render-ascii-exponential-qq samples threshold transforms opts)

Render ASCII exponential Q-Q plot for tail exceedances.

Compares exceedances (values above threshold) to exponential distribution. Points near diagonal indicate exponential tail (GPD with ξ=0).

Parameters: samples - sample array for the metric threshold - threshold value for exceedances transforms - transforms to apply to values opts - options map: :width - chart width in characters (default 60) :height - chart height in lines (default 15) :header-fn - fn [n-exceed] -> header string :indent - string prefix for each line

Returns string of ASCII chart, or nil if insufficient exceedances.

Render ASCII exponential Q-Q plot for tail exceedances.

Compares exceedances (values above threshold) to exponential distribution.
Points near diagonal indicate exponential tail (GPD with ξ=0).

Parameters:
  samples     - sample array for the metric
  threshold   - threshold value for exceedances
  transforms  - transforms to apply to values
  opts        - options map:
    :width      - chart width in characters (default 60)
    :height     - chart height in lines (default 15)
    :header-fn  - fn [n-exceed] -> header string
    :indent     - string prefix for each line

Returns string of ASCII chart, or nil if insufficient exceedances.
sourceraw docstring

render-ascii-gpd-qqclj

(render-ascii-gpd-qq samples threshold gpd-fit transforms opts)

Render ASCII GPD Q-Q plot for tail exceedances.

Compares exceedances to fitted Generalized Pareto Distribution. Points near diagonal indicate good GPD fit.

Parameters: samples - sample array for the metric threshold - threshold value for exceedances gpd-fit - GPD fit map {:xi :sigma} transforms - transforms to apply to values opts - options map: :width - chart width in characters (default 60) :height - chart height in lines (default 15) :header-fn - fn [n-exceed] -> header string :indent - string prefix for each line

Returns string of ASCII chart, or nil if insufficient data.

Render ASCII GPD Q-Q plot for tail exceedances.

Compares exceedances to fitted Generalized Pareto Distribution.
Points near diagonal indicate good GPD fit.

Parameters:
  samples     - sample array for the metric
  threshold   - threshold value for exceedances
  gpd-fit     - GPD fit map {:xi :sigma}
  transforms  - transforms to apply to values
  opts        - options map:
    :width      - chart width in characters (default 60)
    :height     - chart height in lines (default 15)
    :header-fn  - fn [n-exceed] -> header string
    :indent     - string prefix for each line

Returns string of ASCII chart, or nil if insufficient data.
sourceraw docstring

render-ascii-hill-plotclj

(render-ascii-hill-plot tail-data opts)

Render ASCII Hill plot showing tail index estimates vs k.

Parameters: tail-data - tail analysis data for a metric opts - options map: :width - chart width in characters (default 60) :height - chart height in lines (default 15) :header-fn - fn [n] -> header string, where n is number of k values :indent - string prefix for each line

Returns string of ASCII chart, or nil if no Hill data.

Render ASCII Hill plot showing tail index estimates vs k.

Parameters:
  tail-data   - tail analysis data for a metric
  opts        - options map:
    :width      - chart width in characters (default 60)
    :height     - chart height in lines (default 15)
    :header-fn  - fn [n] -> header string, where n is number of k values
    :indent     - string prefix for each line

Returns string of ASCII chart, or nil if no Hill data.
sourceraw docstring

render-ascii-mrl-plotclj

(render-ascii-mrl-plot tail-data transforms opts)

Render ASCII mean residual life plot.

Shows e(u) = E[X - u | X > u] vs threshold u. For GPD data, MRL is linear.

Parameters: tail-data - tail analysis data for a metric transforms - transforms to apply to values opts - options map: :width - chart width in characters (default 60) :height - chart height in lines (default 15) :header-fn - fn [n] -> header string, where n is number of threshold points :indent - string prefix for each line

Returns string of ASCII chart, or nil if no MRL data.

Render ASCII mean residual life plot.

Shows e(u) = E[X - u | X > u] vs threshold u. For GPD data, MRL is linear.

Parameters:
  tail-data   - tail analysis data for a metric
  transforms  - transforms to apply to values
  opts        - options map:
    :width      - chart width in characters (default 60)
    :height     - chart height in lines (default 15)
    :header-fn  - fn [n] -> header string,
                  where n is number of threshold points
    :indent     - string prefix for each line

Returns string of ASCII chart, or nil if no MRL data.
sourceraw docstring

render-ascii-tail-ratiosclj

(render-ascii-tail-ratios tail-data opts)

Render ASCII horizontal bar chart for tail ratios.

Parameters: tail-data - tail analysis data for a metric opts - options map: :width - chart width in characters (default 60) :header-fn - fn [n] -> header string, where n is number of ratios :indent - string prefix for each line

Returns string of ASCII chart, or nil if no ratios.

Render ASCII horizontal bar chart for tail ratios.

Parameters:
  tail-data   - tail analysis data for a metric
  opts        - options map:
    :width      - chart width in characters (default 60)
    :header-fn  - fn [n] -> header string, where n is number of ratios
    :indent     - string prefix for each line

Returns string of ASCII chart, or nil if no ratios.
sourceraw docstring

render-ascii-zipf-plotclj

(render-ascii-zipf-plot samples transforms opts)

Render ASCII Zipf plot (complementary CDF on log-log scale).

For Pareto-like tails, this appears as a straight line with slope -α.

Parameters: samples - sample array for the metric transforms - transforms to apply to sample values opts - options map: :width - chart width in characters (default 60) :height - chart height in lines (default 15) :header-fn - fn [n] -> header string :indent - string prefix for each line

Returns string of ASCII chart, or nil if no samples.

Render ASCII Zipf plot (complementary CDF on log-log scale).

For Pareto-like tails, this appears as a straight line with slope -α.

Parameters:
  samples     - sample array for the metric
  transforms  - transforms to apply to sample values
  opts        - options map:
    :width      - chart width in characters (default 60)
    :height     - chart height in lines (default 15)
    :header-fn  - fn [n] -> header string
    :indent     - string prefix for each line

Returns string of ASCII chart, or nil if no samples.
sourceraw docstring

with-tail-metricsclj

(with-tail-metrics view data-map f)

Iterate over metrics with tail analysis data, calling f for each.

Parameters: view - view options with :tail-analysis-id, :samples-id data-map - analysis data map f - fn [tail-data samples transforms metric-config] -> any

Samples may be nil if :samples-id data is not available.

Iterate over metrics with tail analysis data, calling f for each.

Parameters:
  view     - view options with :tail-analysis-id, :samples-id
  data-map - analysis data map
  f        - fn [tail-data samples transforms metric-config] -> any

Samples may be nil if :samples-id data is not available.
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