protocol

# statisticsp

> Statistical calculations over a list of numbers protocol.

author:
  `Paulo Moura`
version:
  `1.01`
date:
  `2009/1/5`

compilation flags:
  `static`

(no dependencies on other files)

## Public interface

### product/2

> Calculates the product of all list numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `product(List,Product)`
mode – number of proofs:
  `product(+list(number),-number) – zero_or_one`

### sum/2

> Calculates the sum of all list numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `sum(List,Sum)`
mode – number of proofs:
  `sum(+list(number),-number) – zero_or_one`

### max/2

> Determines the list maximum value in a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `max(List,Maximum)`
mode – number of proofs:
  `max(+list,-number) – zero_or_one`

### min/2

> Determines the minimum value in a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `min(List,Minimum)`
mode – number of proofs:
  `min(+list,-number) – zero_or_one`

### range/2

> Range is the length of the smallest interval which contains all the numbers in List. Fails if the list is empty.

compilation flags:
  `static`
template:
  `range(List,Range)`
mode – number of proofs:
  `range(+list,-number) – zero_or_one`

### arithmetic_mean/2

> Calculates the arithmetic mean of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `arithmetic_mean(List,Mean)`
mode – number of proofs:
  `arithmetic_mean(+list(number),-float) – zero_or_one`

### geometric_mean/2

> Calculates the geometric mean of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `geometric_mean(List,Mean)`
mode – number of proofs:
  `geometric_mean(+list(number),-float) – zero_or_one`

### harmonic_mean/2

> Calculates the harmonic mean of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `harmonic_mean(List,Mean)`
mode – number of proofs:
  `harmonic_mean(+list(number),-float) – zero_or_one`

### median/2

> Calculates the median of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `median(List,Median)`
mode – number of proofs:
  `median(+list(number),-float) – zero_or_one`

### average_deviation/3

> Calculates the average absolute deviation of a list of numbers given a central tendency (e.g. mean, median, or mode). Fails if the list is empty.

compilation flags:
  `static`
template:
  `average_deviation(List,CentralTendency,Deviation)`
mode – number of proofs:
  `average_deviation(+list(number),+float,-float) – zero_or_one`

### mean_deviation/2

> Calculates the mean absolute deviation of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `mean_deviation(List,Deviation)`
mode – number of proofs:
  `mean_deviation(+list(number),-float) – zero_or_one`

### median_deviation/2

> Calculates the median absolute deviation of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `median_deviation(List,Deviation)`
mode – number of proofs:
  `median_deviation(+list(number),-float) – zero_or_one`

### standard_deviation/2

> Calculates the standard deviation of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `standard_deviation(List,Deviation)`
mode – number of proofs:
  `standard_deviation(+list(number),-float) – zero_or_one`

### coefficient_of_variation/2

> Calculates the coefficient of variation of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `coefficient_of_variation(List,Coefficient)`
mode – number of proofs:
  `coefficient_of_variation(+list(number),-float) – zero_or_one`

### relative_standard_deviation/2

> Calculates the relative standard deviation of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `relative_standard_deviation(List,Percentage)`
mode – number of proofs:
  `relative_standard_deviation(+list(number),-float) – zero_or_one`

### skewness/2

> Calculates the (moment) skewness of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `skewness(List,Skewness)`
mode – number of proofs:
  `skewness(+list(number),-float) – zero_or_one`

### kurtosis/2

> Calculates the (excess) kurtosis of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `kurtosis(List,Kurtosis)`
mode – number of proofs:
  `kurtosis(+list(number),-float) – zero_or_one`

### variance/2

> Calculates the unbiased variance of a list of numbers. Fails if the list is empty.

compilation flags:
  `static`
template:
  `variance(List,Variance)`
mode – number of proofs:
  `variance(+list(number),-float) – zero_or_one`

### valid/1

> Term is a closed list of numbers.

compilation flags:
  `static`
template:
  `valid(Term)`
mode – number of proofs:
  `valid(@nonvar) – zero_or_one`

## Protected interface

(none)

## Private predicates

### arithmetic_mean/5

compilation flags:
  `static`

### squares_and_cubes/6

compilation flags:
  `static`

### squares_and_hypers/6

compilation flags:
  `static`

### variance/6

compilation flags:
  `static`

## Operators

### (none)

## Remarks

### (none)