Statistical Functions
Statistics is a mathematical discipline which studies ways to collect, summarize and draw conclusions from data. With SpeQ you can calculate the most important statistical properties for a list of values, including the sum, mean, standard deviation, and more. You can read more about using lists in SpeQ on on the page Lists.
Overview
You can use the following built-in statistical functions.
| Function |
Description |
| Min(a, b, c, ...) |
Find the minimum value from a list of values |
| Max(a, b, c, ...) |
Find the maximum value from a list of values |
Mean(a, b, c, ...) Avg(a, b, c, ...) |
Calculate the average value from a list of values |
| Median(a, b, c, ...) |
The median of a list of values is the middle value, when sorted from smallest to largest value. If there is an even number of values, the median is the mean of the two middle values. |
| Sort(a, b, c, ...) |
Sort the given list in ascending order. When there are complex values in the list the values are sorted by their absolute value. |
| Sum(a, b, c, ...) |
Calculate the sum of a list of values |
| Prod(a, b, c, ...) |
Calculate the product of a list of values |
| Var(a, b, c, ...) |
Calculate the variance of a list of values |
| Std(a, b, c, ...) |
Calculate the standard deviation of a list of values |
Definition
The statistical functions are defined as follows.
Examples
'Examples of using Statistical Functions
Min(2, 5, 7)
Ans = 2
Min(-3, 8, -2, -9.5, 12)
Ans = -9.5
Max(2, 7, 5)
Ans = 7
Max(2+8.5, 5, 7, 1.5*Sqrt(16))
Ans = 10.5
Sum(2, 5, 7)
Ans = 14
2+5+7
Ans = 14
Prod(2, 5, 7)
Ans = 70
2*5*7
Ans = 70
Mean(1, 2, 4)
Ans = 2.333333333
(1 + 2 + 4) / 3
Ans = 2.333333333
Var(2, 5, 8)
Ans = 9
Std(2, 5, 8)
Ans = 3
Sort(-3, 8, -2, -9.5, 12)
Ans = (-9.5, -3, -2, 8, 12)
a = (-3, 8, -2, -9.5, 12)
Ans = (-3, 8, -2, -9.5, 12)
Sum(a)
Ans = 5.5
See Also
Functions Overview,
Functionstree,
Lists
|