Mean - Maple Help

SignalProcessing

 Mean
 compute the mean of an array of samples
 StandardDeviation
 compute the standard deviation of an array of samples
 MeanStandardDeviation
 compute, simultaneously, the mean and standard deviation of an array of samples

 Calling Sequence Mean(A) Mean(A,W) StandardDeviation(B) MeanStandardDeviation(B)

Parameters

 A - Array of real or complex numeric values; the signal B - Array of real numeric values; the signal W - Array of real numeric values; the weights

Description

 • The Mean(A) command returns the mean of the Array $A$, defined as

$\mathrm{Mean}\left(A\right)=\frac{{\sum }_{k=1}^{N}{A}_{k}}{N}$

 where $N$ is the number of elements of $A$. When an Array $W$ for weights of size $N$ is provided, the mean is defined instead as

$\mathrm{Mean}\left(A,W\right)=\frac{{\sum }_{k=1}^{N}{A}_{k}{W}_{k}}{{\sum }_{k=1}^{N}{W}_{k}}$

 with $\mathrm{Mean}\left(A,W\right)=\mathrm{Mean}\left(A\right)$ when ${W}_{k}=\frac{1}{N}$.
 • The StandardDeviation(B) command returns the standard deviation of the Array $B$, defined as

$\mathrm{StandardDeviation}\left(B\right)=\sqrt{\frac{{\sum }_{k=1}^{N}{\left({B}_{k}-\mathrm{\mu }\right)}^{2}}{N-1}}$

 where $N$ is the number of elements of $B$, and $\mathrm{\mu }$ is the mean of $B$.
 • The MeanStandardDeviation(B) command computes the mean and standard deviation of $B$ simultaneously, and returns an expression sequence consisting of these values, respectively.
 • The Mean, StandardDeviation, and MeanStandardDeviation commands also accept lists and other types of rtables, both one-dimensional and multi-dimensional, which are then converted to 1-D Arrays.
 • For all of these commands, Maple may convert the input signal. Before the code performing Mean runs, Maple converts $A$ to a hardware datatype, first attempting float[8] and subsequently complex[8], unless it already has one of these datatypes. Similarly, before the code performing StandardDeviation or MeanStandardDeviation runs, $B$ is converted to datatype float[8] if it does not have that datatype already. For this reason, it is most efficient if the input Array has an appropriate datatype already.

The MeanStandardDeviation command is not thread safe.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $a≔\mathrm{Array}\left(\left[1,2,3,4,5\right],'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right)$
 ${a}{≔}\left[\begin{array}{ccccc}{1.}& {2.}& {3.}& {4.}& {5.}\end{array}\right]$ (1)
 > $\mathrm{Mean}\left(a\right)$
 ${3.}$ (2)
 > $w≔\mathrm{Array}\left(\left[5,4,3,2,1\right],'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right)$
 ${w}{≔}\left[\begin{array}{ccccc}{5.}& {4.}& {3.}& {2.}& {1.}\end{array}\right]$ (3)
 > $\mathrm{Mean}\left(a,w\right)$
 ${2.33333333333333348}$ (4)
 > $\mathrm{StandardDeviation}\left(a\right)$
 ${1.58113883008418976}$ (5)
 > $\mathrm{MeanStandardDeviation}\left(a\right)$
 ${3.}{,}{1.58113883008418976}$ (6)

Compatibility

 • The SignalProcessing[Mean], SignalProcessing[StandardDeviation] and SignalProcessing[MeanStandardDeviation] commands were introduced in Maple 17.