Skip to main content

Crate sim_lib_numbers_stats

Crate sim_lib_numbers_stats 

Source
Expand description

Probability, descriptive and robust benchmark statistics, deterministic clustering, streaming quantiles, finite Markov and hidden-state sequence inference, and fairness helpers for number-domain data.

Descriptive statistics and disparate-impact helpers also expose Claim surfaces. The Claim values carry their subject, predicate, and evidence table as inspectable runtime data, so callers can browse both the computed metric and the inputs used to justify it. fit_markov keeps the finite vocabulary, exact counts, additive smoothing, held-out likelihood, deterministic serialization, and corpus provenance inspectable instead of hiding learned weights. QuantileSketch makes rank error and retained memory explicit; forward_backward, viterbi, and fit_hmm keep normalization, convergence, bounded work, numerical repair, and termination evidence. fit_kmeans and fit_gmm add seeded initialization, bounded convergence, regularized covariance, singular-component policy, and model-selection evidence without taking ownership of sequence alignment. exact_binary_interval, paired and clustered bootstrap, sealed RegisteredLookSequence contracts, and fit_isotonic provide the bounded mathematical owner for sequential study decisions. They reuse BootstrapControl and keep confidence, work, cluster independence, censoring, and replay evidence explicit.

Structs§

BinaryInterval
A two-sided Clopper–Pearson interval for a finite binary count.
BinaryOutcomeCounts
Counts for a binary selection or outcome table.
BootstrapControl
Controls a deterministic bootstrap of the candidate-minus-baseline mean.
BootstrapEffectInterval
A percentile bootstrap interval for the candidate-minus-baseline mean.
ClusterSample
One independent cluster, retaining its stable identity and paired rows.
CorpusProvenance
Stable provenance attached to every fitted transition model.
CoverageEvidence
Coverage and replay evidence returned with every design.
DisparateImpact
Disparate-impact summary for two binary-outcome groups.
FairnessClaimValue
A first-class runtime object wrapping the fairness Claim and its evidence.
FairnessEvidence
Evidence carried by the disparate-impact fairness Claim.
FiniteTransitionMatrix
A finite state vocabulary and row-stochastic transition matrix.
ForwardBackward
Normalized forward, backward, and smoothed posterior state probabilities.
GmmControl
Deterministic convergence and work policy for Gaussian-mixture EM.
GmmEvidence
Convergence, regularization, work, and selection evidence from EM.
GmmModel
Inspectable fitted Gaussian-mixture parameters.
GmmReport
Fitted mixture and complete EM evidence.
GmmSpec
Component count, covariance family, regularization, and singular policy.
HiddenMarkovModel
A finite hidden Markov model with inspectable transition and emission rows.
HmmFitControl
Deterministic initialization, convergence, and work policy for Baum-Welch.
HmmFitEvidence
Convergence, likelihood, repair, seed, and termination evidence.
HmmFitReport
A fitted hidden-state model together with complete termination evidence.
InferenceEvidence
Numerical and likelihood evidence from normalized sequence inference.
IsotonicFit
Inspectable weighted pool-adjacent-violators fit.
IsotonicPoint
One weighted raw point supplied to isotonic regression.
KMeansControl
Deterministic initialization, convergence, restart, and work policy for k-means.
KMeansModel
Inspectable k-means centroids and stable cluster assignments.
KMeansReport
Selected model and complete multi-restart evidence.
KMeansRestartEvidence
Convergence evidence for one bounded restart.
KsResult
One- or two-sample Kolmogorov-Smirnov report.
LatinHypercubePlan
Latin hypercube request.
MarkovModel
A finite first-order Markov model retaining exact counts and fitting policy.
MarkovPolicy
Explicit fitting and evaluation policy for a finite first-order model.
ModelReport
A fitted value together with training and held-out evidence.
ModelSelectionEvidence
AIC and BIC evidence for comparing fitted component counts.
PosteriorPath
Per-position maximum-posterior state path.
QuantileEstimate
One quantile estimate together with its retained rank evidence.
QuantilePolicy
Error and memory policy for a QuantileSketch.
QuantileSketch
A deterministic Greenwald-Khanna streaming quantile summary. The sketch stores observations exactly through QuantilePolicy::exact_threshold. Larger streams use rank intervals and deterministic compression. Compatible sketches can be merged without replaying their source streams. The hard entry limit makes memory admission explicit: an operation that cannot retain the requested rank error is rejected transactionally.
RegisteredLook
A pre-registered sequential look and its allocated false-elimination mass.
RegisteredLookSequence
An alpha-spent contract for bounded observations in [0, 1].
SampleDesign
A generated, reconstructable design and its coverage evidence.
SamplerReceipt
Replay receipt captured at an observable sampling boundary.
SamplerState
Canonical, architecture-independent sampler state.
SeededSampler
A public deterministic sampler with explicit version, work, state and forks.
SequentialInterval
A Hoeffding interval valid at its pre-registered look under the sealed budget.
SobolPlan
Sobol base-2 digital-net request. The reviewed direction table is bounded to four dimensions.
StandardizedMoments
Standardized third and fourth moment report.
StatsClaimEvidence
Evidence carried by a descriptive statistics Claim.
StatsClaimValue
A first-class runtime object wrapping a descriptive statistics Claim.
StatsNumbersLib
Library that installs the runtime statistics functions.
SweepPlan
Boundary-injection wrapper for any already generated unit-cube design.
TransitionScore
Aggregate likelihood evidence for a collection of state sequences.
UntestedRegion
Caller-described region intentionally absent from a sweep.
ViterbiPath
Maximum-probability hidden-state path and its joint log probability.

Enums§

ClusteringError
Errors returned by clustering and mixture-model fitting.
CovarianceType
Covariance representation fitted for every Gaussian component.
DesignError
Fail-closed design and sampler errors.
EmissionModel
Discrete or scalar Gaussian emissions for a finite hidden-state model.
GaussianCovariance
Inspectable covariance parameters for one Gaussian component.
GmmTermination
Why bounded EM stopped.
HmmError
Failure while constructing, fitting, or running hidden-state inference.
HmmSpec
Hidden-state and emission family requested from fit_hmm.
HmmTermination
Why bounded Baum-Welch stopped.
KMeansSearchTermination
Why the bounded multi-restart search stopped.
KMeansTermination
Why one k-means restart stopped.
KsMethod
Kolmogorov-Smirnov evaluation policy and applicability identity.
MarkovError
Failure while validating, fitting, scoring, or serializing a Markov model.
MomentConvention
Explicit finite-sample estimator convention.
QuantileError
Failure while configuring, updating, merging, or querying a quantile sketch.
SamplerAlgorithm
Stable identity of a deterministic sampler algorithm.
Scramble
Optional reviewed digital scrambling policy.
Sequence
One homogeneous observation sequence accepted by HMM fitting.
SingularComponentPolicy
Policy for an EM component with negligible responsibility or singular covariance.
StatsError
Errors returned by probability, statistics, and fairness helpers.
ThresholdReadout
Threshold crossing evidence, including censoring beyond the tested range.
TransitionError
Failure while constructing a finite row-stochastic transition matrix.

Statics§

RECIPES
Cookbook recipes for this lib, embedded at build time.

Traits§

HmmObservation
Observation accepted by generic HMM inference.

Functions§

bayesian_update
Computes prior * likelihood / evidence and validates the posterior.
bayesian_update_binary
Computes a binary-test posterior from prior, true-positive, and false-positive rates.
bootstrap_mean_difference_interval
Bootstraps the difference between candidate and baseline arithmetic means.
clustered_bootstrap_interval
Deterministically resamples whole independent clusters with replacement.
disparate_impact
Computes disparate impact and the four-fifths pass/fail flag.
entropy
Computes Shannon entropy in bits for a probability vector that sums to one.
exact_binary_interval
Computes an exact equal-tailed finite-count binary interval.
exact_quantile
Computes the exact linearly interpolated quantile of finite small data.
fairness_claim
Builds the public disparate-impact fairness Claim and interns its evidence object.
fairness_claim_value
Wraps a fairness Claim as a runtime value.
fit_gmm
Fits a regularized diagonal or full-covariance Gaussian mixture.
fit_hmm
Fits a discrete- or continuous-emission HMM with bounded Baum-Welch.
fit_isotonic
Fits a weighted nondecreasing curve with pool-adjacent-violators.
fit_kmeans
Fits deterministic seeded k-means with k-means++ initialization.
fit_markov
Fits an inspectable finite first-order model and reports held-out evidence.
fnv1a64
Computes a stable FNV-1a digest for small transparent fixture corpora.
forward_backward
Runs normalized forward/backward inference in the log domain.
four_fifths_ratio
Computes the comparison/reference rate ratio used by the four-fifths rule.
kolmogorov_smirnov_one_sample
Computes a one-sample KS statistic against a caller-supplied continuous CDF.
kolmogorov_smirnov_two_sample
Computes the two-sample KS statistic. Inputs must represent independent samples.
mean
Computes the arithmetic mean of finite values.
median_absolute_deviation
Computes the raw median absolute deviation from the sample median.
normal_cdf
Standard normal cumulative probability.
normal_density
Standard normal probability density.
normal_quantile
Standard normal quantile, found by bounded monotone inversion.
normal_survival
Standard normal survival probability, evaluated directly in the positive tail.
paired_bootstrap_interval
Deterministically bootstraps paired candidate-minus-baseline effects.
population_variance
Computes population variance with divisor n.
posterior_decode
Decodes the independently most probable hidden state at each position.
sample_variance
Computes sample variance with divisor n - 1.
standardized_moments
Computes standardized third and fourth moments under an explicit convention.
stats_claims_symbol
Returns the symbol bound to the stats/claims batch operation.
stats_clustered_bootstrap_symbol
Returns the symbol bound to cluster-preserving bootstrap intervals.
stats_disparate_impact_claim_symbol
Returns the symbol bound to the stats/disparate-impact-claim operation.
stats_entropy_claim_symbol
Returns the symbol bound to the stats/entropy-claim operation.
stats_exact_binary_interval_symbol
Returns the symbol bound to exact finite binary intervals.
stats_gmm_symbol
Returns the symbol bound to regularized Gaussian-mixture EM.
stats_isotonic_symbol
Returns the symbol bound to weighted isotonic fitting.
stats_kmeans_symbol
Returns the symbol bound to deterministic bounded k-means.
stats_mean_claim_symbol
Returns the symbol bound to the stats/mean-claim operation.
stats_paired_bootstrap_symbol
Returns the symbol bound to paired bootstrap intervals.
stats_registered_look_symbol
Returns the symbol bound to registered-look intervals.
stats_result_claim
Builds the public descriptive statistics Claim and interns its evidence object.
stats_result_claim_value
Wraps a descriptive statistics Claim as a runtime value.
stats_variance_claim_symbol
Returns the symbol bound to the stats/variance-claim operation.
student_t_cdf
Student-t cumulative probability.
student_t_density
Student-t probability density for positive degrees of freedom.
student_t_quantile
Student-t quantile, found by bounded monotone inversion.
student_t_survival
Student-t survival probability, using the direct beta tail for positive values.
variance
Computes population variance.
viterbi
Finds the maximum joint-probability hidden-state path in the log domain.

Type Aliases§

StateId
Stable numeric hidden-state identifier produced by fit_hmm.
StatsResult
Result alias for the statistics helpers, fixing the error to StatsError.