Student[Statistics]
Mode
compute the mode
Calling Sequence
Parameters
Description
Computation
Examples
References
Compatibility
Mode(A, numeric_option, output_option)
Mode(M, numeric_option, output_option)
Mode(X, numeric_option, output_option)
A
-
data sample
M
Matrix data sample
X
algebraic; random variable
numeric_option
(optional) equation of the form numeric=value where value is true or false
output_option
(optional) equation of the form output=x where x is value, plot, or both
The Mode function computes the mode of a specified random variable or a data sample, and then puts the result into a set. The mode of a set of sample data is the most frequently occurring item in it.
The first parameter can be a data sample (e.g., a Vector), a Matrix data sample, a random variable, or an algebraic expression involving random variables (see Student[Statistics][RandomVariable]).
If the option output is not included or is specified to be output=value, then the function will return the value of the mode. If output=plot is specified, then the function will return a plot of the input data set and its mode. If output=both is specified, then both the value and the plot of the mode will be returned.
By default, all computations involving random variables are performed symbolically (see option numeric below).
The Mode function selects the values that occur most frequently in the data set. If values appear differently but have the same numeric value, such as 2, 2.0, and 4, then Mode will consider them equal. If values that appear differently are a mode of the data set, then Mode uses a floating point value equal to that mode if there is one in the data set, or an arbitrarily selected non-floating point value otherwise.
By default, the mode is computed according to the rules mentioned above. To always compute the mode numerically, specify the numeric or numeric = true option.
with⁡StudentStatistics:
Compute the mode of the binomial distribution with parameters p and q.
Mode⁡BinomialRandomVariable⁡p,q
0q=0pq=11+p⁢q,1+p⁢q−11+p⁢q::ℤ1+p⁢qotherwise
Use numeric parameters.
Mode⁡BinomialRandomVariable⁡20,0.6
12
A≔1,2,2,2,2,2,3,4,5,5,5,6,7,7,7,7.0,7,7,8,8,1,1,2,3,4,5:
Mode⁡A
2,7.0
This data sample has two modes: 2 and 7. The value 7 occurs in two versions: as a floating point value and as an integer. Mode uses the floating point value as the return value.
Use the numeric option.
Mode⁡A,numeric
2.,7.0
Use the output=plot option.
Mode⁡A,output=plot
Consider the following Matrix data sample.
M≔Matrix⁡3,π,4,4,π,4,3.0,3.1415926,4,2,1,10,4,110,sqrt⁡2
M≔
Compute the mode of each of the columns.
Mode⁡M
Use the output=both option.
mode,graph≔Mode⁡M,output=both
mode,graph≔?,
mode
graph
Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.
The Student[Statistics][Mode] command was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
Statistics[Mode]
Student
Student[Statistics][RandomVariable]
Download Help Document