category

# `statistics`

Statistical calculations over a list of numbers.

Availability:
`logtalk_load(statistics(loader))`
Author: Paulo Moura
Version: 1:8:0
Date: 2026-02-20
Compilation flags:
`static`
Implements:
`public` statisticsp
Uses:
list
numberlist
Remarks:
(none)
Inherited public predicates:
arithmetic_mean/2 average_deviation/3 central_moment/3 coefficient_of_variation/2 correlation/3 covariance/3 fractile/3 frequency_distribution/2 geometric_mean/2 harmonic_mean/2 interquartile_range/2 kurtosis/2 max/2 mean_deviation/2 mean_squared_error/3 median/2 median_deviation/2 min/2 min_max/3 min_max_normalization/2 modes/2 percentile/3 product/2 quartiles/4 range/2 rank_correlation/3 relative_standard_deviation/2 root_mean_squared_error/3 skewness/2 standard_deviation/2 standard_error/2 sum/2 sum_of_squares/2 trimmed_mean/3 valid/1 variance/2 weighted_mean/3 z_normalization/2

## Public predicates

(no local declarations; see entity ancestors if any)

## Protected predicates

(no local declarations; see entity ancestors if any)

## Private predicates

### `arithmetic_mean/5`

Auxiliary predicate for computing the arithmetic mean.

Compilation flags:
`static`
Template:
`arithmetic_mean(List,Length0,Length,Sum,Mean)`
Mode and number of proofs:
`arithmetic_mean(+list(number),+integer,-integer,+number,-float)` - `one`

### `squares_and_cubes/6`

Auxiliary predicate for computing the skewness.

Compilation flags:
`static`
Template:
`squares_and_cubes(List,Mean,Squares0,Squares,Cubes0,Cubes)`
Mode and number of proofs:
`squares_and_cubes(+list(number),+float,+float,-float,+float,-float)` - `one`

### `squares_and_hypers/6`

Auxiliary predicate for computing the kurtosis.

Compilation flags:
`static`
Template:
`squares_and_hypers(List,Mean,Squares0,Squares,Hypers0,Hypers)`
Mode and number of proofs:
`squares_and_hypers(+list(number),+float,+float,-float,+float,-float)` - `one`

### `variance/6`

Auxiliary predicate for computing the variance.

Compilation flags:
`static`
Template:
`variance(List,Length0,Length,Mean,M20,M2)`
Mode and number of proofs:
`variance(+list(number),+integer,-integer,+float,+float,-float)` - `one`

### `cross_deviation_sum/6`

Auxiliary predicate for computing the cross-deviation sum for covariance.

Compilation flags:
`static`
Template:
`cross_deviation_sum(List1,List2,Mean1,Mean2,Sum0,Sum)`
Mode and number of proofs:
`cross_deviation_sum(+list(number),+list(number),+float,+float,+float,-float)` - `one`

### `sorted_median/3`

Auxiliary predicate for computing the median of an already sorted list with known length.

Compilation flags:
`static`
Template:
`sorted_median(Sorted,Length,Median)`
Mode and number of proofs:
`sorted_median(+list(number),+integer,-number)` - `one`

### `sum_of_squares/4`

Auxiliary predicate for computing the sum of squared deviations.

Compilation flags:
`static`
Template:
`sum_of_squares(List,Mean,Sum0,Sum)`
Mode and number of proofs:
`sum_of_squares(+list(number),+float,+float,-float)` - `one`

### `central_moment_sum/7`

Auxiliary predicate for computing central moments.

Compilation flags:
`static`
Template:
`central_moment_sum(List,K,Mean,N0,Sum0,N,Sum)`
Mode and number of proofs:
`central_moment_sum(+list(number),+positive_integer,+float,+integer,+float,-integer,-float)` - `one`

### `min_max_normalize/4`

Auxiliary predicate for min-max normalization.

Compilation flags:
`static`
Template:
`min_max_normalize(List,Min,Range,NormalizedList)`
Mode and number of proofs:
`min_max_normalize(+list(number),+number,+number,-list(float))` - `one`

### `count_frequencies/4`

Auxiliary predicate for computing frequency distribution.

Compilation flags:
`static`
Template:
`count_frequencies(List,CurrentValue,CurrentCount,Distribution)`
Mode and number of proofs:
`count_frequencies(+list(number),+number,+integer,-list(pair(number,integer)))` - `one`

### `squared_error_sum/6`

Auxiliary predicate for computing mean squared error.

Compilation flags:
`static`
Template:
`squared_error_sum(List1,List2,N0,Sum0,N,Sum)`
Mode and number of proofs:
`squared_error_sum(+list(number),+list(number),+integer,+float,-integer,-float)` - `one`

### `compute_ranks/3`

Auxiliary predicate for computing ranks of elements in a list.

Compilation flags:
`static`
Template:
`compute_ranks(List,All,Ranks)`
Mode and number of proofs:
`compute_ranks(+list(number),+list(number),-list(float))` - `one`

### `count_less_equal/6`

Auxiliary predicate for counting elements less than and equal to a value.

Compilation flags:
`static`
Template:
`count_less_equal(List,Value,Less0,Less,Equal0,Equal)`
Mode and number of proofs:
`count_less_equal(+list(number),+number,+integer,-integer,+integer,-integer)` - `one`

## Operators

(none)