Liking cljdoc? Tell your friends :D

criterium.stats.core

Core statistical functions: min, max, mean, sum, variance, median, quartiles, quantile.

All functions require typed arrays (ITypedArray) as input. Primitive-optimized implementations avoid boxing overhead.

Core statistical functions: min, max, mean, sum, variance, median, quartiles, quantile.

All functions require typed arrays (ITypedArray) as input.
Primitive-optimized implementations avoid boxing overhead.
raw docstring

accumulate-variance!clj

(accumulate-variance! acc x)
source

central-momentclj

(central-moment data mean r)

Compute the r-th central moment: (1/n) * Σ(xᵢ - μ)^r Requires a typed array (ITypedArray).

Compute the r-th central moment: (1/n) * Σ(xᵢ - μ)^r
Requires a typed array (ITypedArray).
sourceraw docstring

cvclj

(cv data)

Coefficient of variation (CV), also known as relative standard deviation. Computed as σ/μ (standard deviation divided by mean).

Returns Double/NaN if mean is zero or data has fewer than 2 elements. CV is dimensionless and useful for comparing variability across datasets with different units or scales. Requires a typed array (ITypedArray).

Coefficient of variation (CV), also known as relative standard deviation.
Computed as σ/μ (standard deviation divided by mean).

Returns Double/NaN if mean is zero or data has fewer than 2 elements.
CV is dimensionless and useful for comparing variability across datasets
with different units or scales.
Requires a typed array (ITypedArray).
sourceraw docstring

kurtosisclj

(kurtosis data)
(kurtosis data type)

Compute sample excess kurtosis using one of three methods.

Type 1: g₂ = m₄ / m₂² - 3 - typical textbook definition Type 2: G₂ = ((n+1)g₂ + 6)(n-1) / ((n-2)(n-3)) - unbiased under normality (SAS/SPSS) Type 3: b₂ = (g₂ + 3)((n-1)/n)² - 3 - used in MINITAB/BMDP

Where m_r = sample central moment of order r: Σ(xᵢ - μ)^r / n

Default is type 2 (unbiased under normality). Returns excess kurtosis (normal distribution has excess kurtosis of 0). Returns 0.0 for constant data (zero variance). Requires a typed array (ITypedArray).

Reference: Joanes & Gill (1998), Comparing measures of sample skewness and kurtosis. The Statistician, 47, 183-189.

Compute sample excess kurtosis using one of three methods.

Type 1: g₂ = m₄ / m₂² - 3 - typical textbook definition
Type 2: G₂ = ((n+1)g₂ + 6)(n-1) / ((n-2)(n-3)) - unbiased under normality (SAS/SPSS)
Type 3: b₂ = (g₂ + 3)((n-1)/n)² - 3 - used in MINITAB/BMDP

Where m_r = sample central moment of order r: Σ(xᵢ - μ)^r / n

Default is type 2 (unbiased under normality). Returns excess kurtosis
(normal distribution has excess kurtosis of 0).
Returns 0.0 for constant data (zero variance).
Requires a typed array (ITypedArray).

Reference: Joanes & Gill (1998), Comparing measures of sample skewness
           and kurtosis. The Statistician, 47, 183-189.
sourceraw docstring

maxclj

(max data)
(max data _count)

Maximum value in data. Requires a typed array (ITypedArray).

Maximum value in data.
Requires a typed array (ITypedArray).
sourceraw docstring

meanclj

(mean data)
(mean data count)

Arithmetic mean of data. Requires a typed array (ITypedArray).

Arithmetic mean of data.
Requires a typed array (ITypedArray).
sourceraw docstring

medianclj

(median data)

Calculate the median of a sorted data set. Return [median nil nil] (partitions not supported for typed arrays). Requires a typed array (ITypedArray). References: http://en.wikipedia.org/wiki/Median

Calculate the median of a sorted data set.
Return [median nil nil] (partitions not supported for typed arrays).
Requires a typed array (ITypedArray).
References: http://en.wikipedia.org/wiki/Median
sourceraw docstring

median-valueclj

(median-value data)

Calculate the median value of a sorted data set. Returns just the median value (not the lower/upper partitions). Requires a typed array (ITypedArray). References: http://en.wikipedia.org/wiki/Median

Calculate the median value of a sorted data set.
Returns just the median value (not the lower/upper partitions).
Requires a typed array (ITypedArray).
References: http://en.wikipedia.org/wiki/Median
sourceraw docstring

minclj

(min data)
(min data _count)

Minimum value in data. Requires a typed array (ITypedArray).

Minimum value in data.
Requires a typed array (ITypedArray).
sourceraw docstring

quantileclj

(quantile quantile data)

Calculate the quantile of a sorted data set. Requires a typed array (ITypedArray). References: http://en.wikipedia.org/wiki/Quantile

Calculate the quantile of a sorted data set.
Requires a typed array (ITypedArray).
References: http://en.wikipedia.org/wiki/Quantile
sourceraw docstring

quartilesclj

(quartiles data)

Calculate the quartiles of a sorted data set. Returns [q1 median q3]. Requires a typed array (ITypedArray). References: http://en.wikipedia.org/wiki/Quartile

Calculate the quartiles of a sorted data set.
Returns [q1 median q3].
Requires a typed array (ITypedArray).
References: http://en.wikipedia.org/wiki/Quartile
sourceraw docstring

skewnessclj

(skewness data)
(skewness data type)

Compute sample skewness using one of three methods.

Type 1: g₁ = m₃ / m₂^(3/2) - typical textbook definition Type 2: G₁ = g₁ × √(n(n-1)) / (n-2) - unbiased under normality (SAS/SPSS) Type 3: b₁ = g₁ × ((n-1)/n)^(3/2) - used in MINITAB/BMDP

Where m_r = sample central moment of order r: Σ(xᵢ - μ)^r / n

Default is type 2 (unbiased under normality). Returns 0.0 for constant data (zero variance), since constant data is symmetric. Requires a typed array (ITypedArray).

Reference: Joanes & Gill (1998), Comparing measures of sample skewness and kurtosis. The Statistician, 47, 183-189.

Compute sample skewness using one of three methods.

Type 1: g₁ = m₃ / m₂^(3/2) - typical textbook definition
Type 2: G₁ = g₁ × √(n(n-1)) / (n-2) - unbiased under normality (SAS/SPSS)
Type 3: b₁ = g₁ × ((n-1)/n)^(3/2) - used in MINITAB/BMDP

Where m_r = sample central moment of order r: Σ(xᵢ - μ)^r / n

Default is type 2 (unbiased under normality).
Returns 0.0 for constant data (zero variance), since constant data is symmetric.
Requires a typed array (ITypedArray).

Reference: Joanes & Gill (1998), Comparing measures of sample skewness
           and kurtosis. The Statistician, 47, 183-189.
sourceraw docstring

sumclj

(sum data)

Sum of each data point. Requires a typed array (ITypedArray).

Sum of each data point.
Requires a typed array (ITypedArray).
sourceraw docstring

sum-of-squaresclj

(sum-of-squares data)

Sum of the squares of each data point. Requires a typed array (ITypedArray).

Sum of the squares of each data point.
Requires a typed array (ITypedArray).
sourceraw docstring

transposeclj

(transpose data)

Transpose a vector of vectors.

Transpose a vector of vectors.
sourceraw docstring

varianceclj

(variance data)
(variance data df)

Return the variance of data.

By default returns the sample variance with (- (count data) 1) degrees of freedom.

The population variance can be returned using (variance data 0), which uses (count data) degrees of freedom.

Requires a typed array (ITypedArray).

Ref: Chan et al. Algorithms for computing the sample variance: analysis and recommendations. American Statistician (1983).

Return the variance of data.

By default returns the sample variance with (- (count data) 1) degrees
of freedom.

The population variance can be returned using (variance data 0), which uses
(count data) degrees of freedom.

Requires a typed array (ITypedArray).

Ref: Chan et al. Algorithms for computing the sample variance: analysis and
     recommendations. American Statistician (1983).
sourceraw docstring

variance*clj

(variance* data mean df)

Variance based on subtracting mean. Requires a typed array (ITypedArray).

Variance based on subtracting mean.
Requires a typed array (ITypedArray).
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