Student[Statistics] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Education : Student Package : Statistics : Student/Statistics/Mode

Student[Statistics]

  

Mode

  

compute the mode

 

Calling Sequence

Parameters

Description

Computation

Examples

References

Compatibility

Calling Sequence

Mode(A, numeric_option, output_option)

Mode(M, numeric_option, output_option)

Mode(X, numeric_option, output_option)

Parameters

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

Description

• 

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.

Computation

• 

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.

Examples

withStudent[Statistics]:

Compute the mode of the binomial distribution with parameters p and q.

ModeBinomialRandomVariablep,q

floorp+1q

(1)

Use numeric parameters.

ModeBinomialRandomVariable20,0.6

12

(2)

A1,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:

ModeA

2,7.0

(3)

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.

ModeA,numeric

2.,7.0

(4)

Use the output=plot option.

ModeA,output=plot

Consider the following Matrix data sample.

MMatrix3,π,4,4,π,4,3.0,3.1415926,4,2,1,10,4,110,2

M3π44π43.03.14159264211041102

(5)

Compute the mode of each of the columns.

ModeM

4,3.0π4

(6)

Use the output=both option.

mode,graphModeM,output=both

mode,graph4,3.0π4,

(7)

mode

4,3.0π4

(8)

graph

References

  

Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.

Compatibility

• 

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]

Student[Statistics][RandomVariable]