Student[Statistics] - Maple Programming Help

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

Student[Statistics]

 StandardDeviation
 compute the standard deviation

 Calling Sequence StandardDeviation(A, numeric_option, output_option) StandardDeviation(M, numeric_option, output_option) StandardDeviation(X, numeric_option, inert_option, output_option)

Parameters

 A - M - 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 inert_option - (optional) equation of the form inert=value where value is true or false

Description

 • The StandardDeviation function computes the standard deviation of the specified data sample or random variable.  In the data sample case the unbiased estimate for the variance is used (see Student[Statistics][Variance] for more details).
 • 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 standard deviation. If output=plot is specified, then the function will return a plot of the input data set and its standard deviation. If output=both is specified, then both the value and the plot of the standard deviation will be returned.
 • If the option inert is not included or is specified to be inert=false, then the function will return the actual value of the result. If inert or inert=true is specified, then the function will return the formula of evaluating the actual value.

Computation

 • By default, all computations involving random variables are performed symbolically (see option numeric below).
 • If there are floating point values or the option numeric is included, then the computation is done in floating point. Otherwise the computation is exact.
 • By default, the standard deviation is computed according to the rules mentioned above. To always compute the standard deviation numerically, specify the numeric or numeric = true option.

Examples

 > $\mathrm{with}\left(\mathrm{Student}[\mathrm{Statistics}]\right):$

Compute the standard deviation of the beta random variable with parameters $p$ and $q$.

 > $\mathrm{StandardDeviation}\left(\mathrm{BetaRandomVariable}\left(p,q\right)\right)$
 $\frac{\sqrt{\frac{{p}{}{q}}{{p}{+}{q}{+}{1}}}}{{p}{+}{q}}$ (1)

Use the numeric or the output=plot option

 > $\mathrm{StandardDeviation}\left(\mathrm{BetaRandomVariable}\left(3,5\right),\mathrm{numeric}\right)$
 ${0.1613743061}$ (2)
 > $\mathrm{StandardDeviation}\left(\mathrm{BetaRandomVariable}\left(3,5\right),\mathrm{output}=\mathrm{plot}\right)$ Create a beta-distributed random variable $Y$ and compute the standard deviation of $\frac{1}{Y+2}$.

 > $Y≔\mathrm{BetaRandomVariable}\left(5,2\right):$
 > $\mathrm{StandardDeviation}\left(\frac{1}{Y+2}\right)$
 $\frac{{1}}{{2}}{}\sqrt{{-}{1356439}{-}{6708480}{}{\mathrm{ln}}{}\left({2}\right){+}{16588800}{}{\mathrm{ln}}{}\left({3}\right){}{\mathrm{ln}}{}\left({2}\right){-}{8294400}{}{{\mathrm{ln}}{}\left({2}\right)}^{{2}}{-}{8294400}{}{{\mathrm{ln}}{}\left({3}\right)}^{{2}}{+}{6708480}{}{\mathrm{ln}}{}\left({3}\right)}$ (3)
 > $\mathrm{StandardDeviation}\left(\frac{1}{Y+2},\mathrm{numeric}\right)$
 ${0.02274855629}$ (4)

Compute the standard deviation of a data set, which contains an undefined value

 > $\mathrm{StandardDeviation}\left(\left[1,2,4,0,\mathrm{undefined}\right]\right)$
 ${\mathrm{undefined}}$ (5)

Consider the following Matrix data sample.

 > $M≔\mathrm{Matrix}\left(\left[\left[4,\mathrm{π},114694\right],\left[4.2,15,127368\right],\left[3.0,7,88464\right]\right]\right)$
 ${M}{≔}\left[\begin{array}{ccc}{4}& {\mathrm{π}}& {114694}\\ {4.2}& {15}& {127368}\\ {3.0}& {7}& {88464}\end{array}\right]$ (6)

Compute the standard deviation of each of the columns.

 > $\mathrm{StandardDeviation}\left(M\right)$
 $\left[\begin{array}{ccc}{0.642910050732864}& \frac{{1}}{{2}}{}\sqrt{{2}{}{\left(\frac{{2}}{{3}}{}{\mathrm{π}}{-}\frac{{22}}{{3}}\right)}^{{2}}{+}{2}{}{\left(\frac{{23}}{{3}}{-}\frac{{1}}{{3}}{}{\mathrm{π}}\right)}^{{2}}{+}{2}{}{\left({-}\frac{{1}}{{3}}{-}\frac{{1}}{{3}}{}{\mathrm{π}}\right)}^{{2}}}& \frac{{2}}{{3}}{}\sqrt{{885811647}}\end{array}\right]$ (7)

If the output=both option is included, then both the value and the plot of the standard deviation will be returned.

 > $\mathrm{sd1},\mathrm{graph1}≔\mathrm{StandardDeviation}\left(M,\mathrm{output}=\mathrm{both}\right):$
 > $\mathrm{sd1}$
 $\left[\begin{array}{ccc}{0.642910050732864}& \frac{{1}}{{2}}{}\sqrt{{2}{}{\left(\frac{{2}}{{3}}{}{\mathrm{π}}{-}\frac{{22}}{{3}}\right)}^{{2}}{+}{2}{}{\left(\frac{{23}}{{3}}{-}\frac{{1}}{{3}}{}{\mathrm{π}}\right)}^{{2}}{+}{2}{}{\left({-}\frac{{1}}{{3}}{-}\frac{{1}}{{3}}{}{\mathrm{π}}\right)}^{{2}}}& \frac{{2}}{{3}}{}\sqrt{{885811647}}\end{array}\right]$ (8)
 > $\mathrm{graph1}$   Use both the output=both option and the inert option.

 > $K≔\mathrm{BinomialRandomVariable}\left(5,\frac{1}{3}\right):$
 > $\mathrm{sd2},\mathrm{graph2}≔\mathrm{StandardDeviation}\left(K,\mathrm{output}=\mathrm{both},\mathrm{inert}\right):$
 > $\mathrm{StandardDeviation}\left(K,\mathrm{numeric}\right)$
 ${1.054092553}$ (9)
 > $\mathrm{sd2}$
 $\sqrt{{\sum }_{{\mathrm{_t0}}{=}{0}}^{{5}}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}{\left({\mathrm{_t0}}{-}{\sum }_{{\mathrm{_t}}{=}{0}}^{{5}}\phantom{\rule[-0.0ex]{5.0px}{0.0ex}}{\mathrm{_t}}{}{\mathrm{binomial}}{}\left({5}{,}{\mathrm{_t}}\right){}{\left(\frac{{1}}{{3}}\right)}^{{\mathrm{_t}}}{}{\left(\frac{{2}}{{3}}\right)}^{{5}{-}{\mathrm{_t}}}\right)}^{{2}}{}{\mathrm{binomial}}{}\left({5}{,}{\mathrm{_t0}}\right){}{\left(\frac{{1}}{{3}}\right)}^{{\mathrm{_t0}}}{}{\left(\frac{{2}}{{3}}\right)}^{{5}{-}{\mathrm{_t0}}}}$ (10)
 > $\mathrm{evalf}\left(\mathrm{sd2}\right)$
 ${1.054092553}$ (11)
 > $\mathrm{graph2}$ > 

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][StandardDeviation] command was introduced in Maple 18.