Numerical Statistics Demo

Manuale del reference plugin per statistiche numeriche.

Indice

Reference/demo
Questa pagina descrive un modulo dimostrativo. Per il normale catalogo degli strumenti vai a Moduli numerici; per le firme delle primitive vai a NUMERIC_API_v1.

Plugin ID: demo.numeric.statistics
Plugin version: 1.0.0
Reference framework: GX-TXT 0.9.7.82
License: GNU GPL v3 or later

1. Purpose

This plugin is a compact demonstration/reference consumer of GX-TXT’s public numerical architecture. It demonstrates statistics on a Canonical Dataset through math.numeric / NUMERIC_API_v1, publishes reusable derived Datasets, writes a human-readable report and renders an automatic graph.

It is not the future production family of descriptive/grouped/correlation statistics modules.

2. Public GX-TXT APIs used

The implementation uses only public framework paths relevant to the task:

No CORE code is modified by this plugin.

3. Statistical capabilities found in GX-TXT 0.9.7.82

The inspected math.numeric 1.1.0 public API provides descriptive statistics, quantiles and weighted statistics, including Dataset-aware descriptive and weighted operations.

Descriptive statistics return:

Quantiles use Hyndman-Fan type 7 linear interpolation.

Weighted statistics return:

Standalone statistical covariance/correlation operations are not exposed by the current NUMERIC_API_v1. Covariance objects present in fitting and uncertainty-propagation APIs are different capabilities. This demo therefore has no covariance/correlation mode.

4. Session Generator

The package includes the portable Session Generator:

Library:      GX-TXT Numerical Examples
Category:     Mathematics
Generator:    Statistics
generator_id: statistics
version:      1.0.0

Import session_generators/gxtxt_numerical_examples_statistics_1.0.0.zip with the Library Manager. The generated ordinary Session contains:

raw/statistics_demo.csv
metadata/ground_truth.txt

The plugin never reads ground_truth.txt during analysis. That file exists only for human inspection and independent tests.

5. Source Dataset import

Import raw/statistics_demo.csv through the normal Acquisition / generic CSV workflow as a table.generic Canonical Dataset. A documented example Dataset ID is:

statistics.source

Suggested variable semantics/units:

CSV column Unit Suggested role
sample 1 independent
value_V V measured
weight 1 weight

Do not rely on the example’s imported variable IDs. The module resolves stable IDs from Analysis Source / Variable Schema runtime data.

6. Configuration

The compact module configuration contains:

Descriptive is the default mode.

7. Dataset Selection

If an X-range Dataset Selection is chosen, it is passed to the Dataset-aware numerical operation through the public Selection structure. The same public selection mask is used only to prepare matching counts and graph-series rows; the plugin does not implement a private filter language.

Input count in the report means rows remaining after the Dataset Selection and before the selected non-finite policy.

8. NaN / Inf policy

The public math.numeric default is nonfinite=error. This demo exposes the policy explicitly and defaults its example workflow to omit because the deterministic Statistics dataset contains three missing-value markers that the public CSV provider exposes numerically as NaN.

With omit:

The report states input, valid/used and excluded non-finite counts. In weighted mode it separately reports finite pairs, positive-weight observations and zero-weight observations.

With error, the public numerical operation rejects non-finite input and the plugin does not publish partial output.

9. Weight semantics

The Weight binding is an explicit statistical weight. It is not a measurement uncertainty.

A Dataset uncertainty column, if present in some other source, is not automatically reinterpreted as a weight. If a scientific workflow requires inverse-variance weights derived from uncertainty, that transformation must be explicit in the appropriate analysis workflow; this demo does not invent it.

Zero weights are discarded by the public weighted-statistics operation. Negative weights are errors. At least one positive weight is required.

Weighted quantiles use the public weighted empirical CDF inverse definition.

10. Variance and standard-deviation conventions

Descriptive mode reports both conventions returned by NUMERIC_API_v1:

Weighted mode reports:

The plugin does not choose an alternative convention.

11. Units

Minimum, maximum, range, sum, mean, median, standard deviation, RMS and quantiles retain the Value variable unit.

Variance is published/reported with the squared-unit expression, for example V^2. GX-TXT’s Unit Registry parser supports simple powers; no false unchanged V metadata is assigned to variance.

Counts and effective sample size are dimensionless. Weighted sum carries value*weight units when the Weight variable itself is not dimensionless. Correlation is not produced because no public correlation operation is exposed in this framework version.

12. Derived Datasets

Summary Dataset

Default ID:

demo.numeric.statistics.result

Schema:

Variable Type Meaning
statistic string Stable statistic name
value float64 Computed numeric value
unit string Per-statistic scientific unit
definition string Definition/convention note

A long-form schema is used because different statistics have different units. The numeric value column therefore does not falsely claim one common unit; the per-row unit field carries the correct unit.

Graph/reuse series Dataset

Default ID:

demo.numeric.statistics.result.series

It contains the observations actually included by the public operation, a sequential included-observation index, constant mean and median reference series, and explicit weights in weighted mode. It is suitable for normal downstream Dataset consumers, including plot.dataset.

13. Provenance

Publication records include:

The source Dataset is never modified.

14. Report

statistics_report.txt contains:

statistics_metrics.ini provides a compact machine-readable run summary.

15. Automatic graph

01_statistics_values.png plots observations actually used by the selected public operation and overlays its mean and median. Weighted mode labels the reference lines as weighted mean/median.

The graph is module-owned but uses GX-TXT shared graphics/Graph Provider infrastructure. Rerender uses only render_cache.mat; it does not recalculate statistics.

16. Save/reopen

Module settings use the normal Standard Module manifest path. The test suite verifies persistence of mode, non-finite policy, output Dataset ID, binding configuration and Selection ID through manifest write/reload.

Published Datasets are ordinary registered Canonical Datasets and remain addressable after Session reopen according to normal GX-TXT Dataset persistence.

17. Tests

The package contains:

tests/test_static.py
tests/test_framework_integration.tcl

Coverage includes deterministic generator data, normal/constant/signed/single-value/non-finite numerical semantics, explicit weighted behavior, package installation, generator import, Canonical Dataset import, stable variable resolution, API capability discovery, Selection persistence and real Octave execution when available.

Runtime-dependent checks are reported as SKIP when GNU Octave is absent; no PASS is fabricated.

See TEST_RESULTS.md for the execution performed for this release.

18. Known limitations