Skip to main content

Crate sim_lib_numbers_stats

Crate sim_lib_numbers_stats 

Source
Expand description

Probability, descriptive 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.

Structs§

BinaryOutcomeCounts
Counts for a binary selection or outcome table.
CorpusProvenance
Stable provenance attached to every fitted transition model.
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.
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.
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.
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.
TransitionScore
Aggregate likelihood evidence for a collection of state sequences.
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.
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.
MarkovError
Failure while validating, fitting, scoring, or serializing a Markov model.
QuantileError
Failure while configuring, updating, merging, or querying a quantile sketch.
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.
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.
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_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_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.
mean
Computes the arithmetic mean of finite values.
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.
stats_claims_symbol
Returns the symbol bound to the stats/claims batch operation.
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_gmm_symbol
Returns the symbol bound to regularized Gaussian-mixture EM.
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_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.
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.