stats

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PackageProps = packageprops.Props{
	WASMWASI:         packageprops.WASMCompiles,
	WASMJS:           packageprops.WASMCompiles,
	WASMFreestanding: packageprops.WASMCompiles,
}

PackageProps records this package's curated properties (ADR-0080). Seeded by `boxer code analysis golang wasmsurvey props generate`; curate by hand. The same group's `props verify` reconciles it.

Functions

This section is empty.

Types

type ConvergenceDetector

type ConvergenceDetector struct {
	*StreamStats
	// contains filtered or unexported fields
}

ConvergenceDetector wraps StreamStats to detect when the standard deviation stabilizes.

func NewConvergenceDetector

func NewConvergenceDetector(windowSize int, varianceTolerance float64) (inst *ConvergenceDetector)

func (*ConvergenceDetector) CheckConvergence

func (inst *ConvergenceDetector) CheckConvergence() (stable bool)

func (*ConvergenceDetector) Push

func (inst *ConvergenceDetector) Push(x float64) (stable bool)

func (*ConvergenceDetector) Reset

func (inst *ConvergenceDetector) Reset()

type StreamStats

type StreamStats struct {
	// contains filtered or unexported fields
}

StreamStats computes Mean, Variance, Skewness, Kurtosis, Min, and Max using Compensated (Kahan) Welford's Algorithm.

func NewStreamStats

func NewStreamStats() (inst *StreamStats)

func (*StreamStats) Count

func (inst *StreamStats) Count() int64

func (*StreamStats) IsMeanPrecise

func (inst *StreamStats) IsMeanPrecise(relativePrecision float64) (precise bool)

IsMeanPrecise returns true if the 95% confidence interval of the mean is smaller than the given relative precision.

func (*StreamStats) Kurtosis

func (inst *StreamStats) Kurtosis() float64

Kurtosis returns the Excess Kurtosis (fisher). Normal distribution = 0.0. Returns 0 if variance is 0 or N < 4.

func (*StreamStats) MarshalJSON

func (inst *StreamStats) MarshalJSON() (data []byte, err error)

func (*StreamStats) Max

func (inst *StreamStats) Max() float64

func (*StreamStats) Mean

func (inst *StreamStats) Mean() float64

func (*StreamStats) Merge

func (inst *StreamStats) Merge(other *StreamStats)

Merge combines another StreamStats into this one using Pébay's formulas.

func (*StreamStats) Min

func (inst *StreamStats) Min() float64

func (*StreamStats) Push

func (inst *StreamStats) Push(x float64)

Push adds a single float64 value. Complexity: O(1).

func (*StreamStats) PushFloat32

func (inst *StreamStats) PushFloat32(x float32)

func (*StreamStats) PushSeq

func (inst *StreamStats) PushSeq(seq iter.Seq[float64])

func (*StreamStats) Reset

func (inst *StreamStats) Reset()

func (*StreamStats) Skewness

func (inst *StreamStats) Skewness() float64

Skewness returns the Fisher-Pearson coefficient of skewness. Returns 0 if variance is 0 or N < 3.

func (*StreamStats) StdDev

func (inst *StreamStats) StdDev() float64

func (*StreamStats) UnmarshalJSON

func (inst *StreamStats) UnmarshalJSON(data []byte) (err error)

func (*StreamStats) Variance

func (inst *StreamStats) Variance() float64

Variance returns the sample variance.

Directories

Path Synopsis
Package distsql implements the ADR-0161 distribution result contract: the fixed probability grid the descriptiveStatistics macro emits, the claim validation rules the play Distribution panel applies, and the letterval.QuantileOracle adapter that feeds a boxenplot ladder from a server-side quantile grid.
Package distsql implements the ADR-0161 distribution result contract: the fixed probability grid the descriptiveStatistics macro emits, the claim validation rules the play Distribution panel applies, and the letterval.QuantileOracle adapter that feeds a boxenplot ladder from a server-side quantile grid.
Package ecdfbands implements finite-sample exact simultaneous confidence bands on the empirical cumulative distribution function of an iid univariate sample.
Package ecdfbands implements finite-sample exact simultaneous confidence bands on the empirical cumulative distribution function of an iid univariate sample.
digest
Package digest bridges a tdigest.TDigest to the ecdfbands library.
Package digest bridges a tdigest.TDigest to the ecdfbands library.
Package letterval computes letter-value summaries (Hofmann, Wickham & Kafadar 2017) from any source that can answer Quantile/CDF queries.
Package letterval computes letter-value summaries (Hofmann, Wickham & Kafadar 2017) from any source that can answer Quantile/CDF queries.
Package tdigest provides a streaming quantile sketch with tail-biased accuracy, based on Dunning 2019 (arXiv:1902.04023).
Package tdigest provides a streaming quantile sketch with tail-biased accuracy, based on Dunning 2019 (arXiv:1902.04023).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL