 Simulation Commands - Maple Programming Help

Home : Support : Online Help : Statistics and Data Analysis : Statistics Package : Simulation : Statistics/Simulation

Simulation Commands

 The Statistics package provides optimized algorithms for simulating from all supported distributions as well as tools for creating custom random number generators, parametric and non-parametric bootstrap.

 compute bootstrap statistics sample a kernel density estimate generate random sample

Examples

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

Generate random sample drawn from the non-central beta distribution.

 > $X≔\mathrm{RandomVariable}\left(\mathrm{NonCentralBeta}\left(3,10,2\right)\right):$
 > $A≔\mathrm{Sample}\left(X,1000\right)$
  (1)

Use the bootstrap to estimate the mean and the standard error of the mean.

 > $\mathrm{Bootstrap}\left(\mathrm{Mean},X,\mathrm{replications}=1000,\mathrm{output}=\left['\mathrm{value}','\mathrm{standarderror}'\right]\right)$
 $\left[{0.282229356166131}{,}{0.00399644288773034952}\right]$ (2)
 > $\mathrm{Bootstrap}\left(\mathrm{Mean},A,\mathrm{replications}=1000,\mathrm{output}=\left['\mathrm{value}','\mathrm{standarderror}'\right]\right)$
 $\left[{0.275083017014237}{,}{0.00384426186874453797}\right]$ (3)

Compare this with analytic results.

 > $\mathrm{Mean}\left(X\right)$
 ${-}{1762148409}{+}{4790016000}{}{{ⅇ}}^{{-1}}$ (4)
 > $\mathrm{evalf}\left[30\right]\left(\mathrm{Mean}\left(X\right)\right)$
 ${0.28226746351970438745}$ (5)
 > $\mathrm{Mean}\left(X,\mathrm{numeric}\right)$
 ${0.2822674635}$ (6)

Random sample involving two independent random variables.

 > $Y≔\mathrm{RandomVariable}\left(\mathrm{Cauchy}\left(0,1\right)\right)$
 ${Y}{≔}{\mathrm{_R0}}$ (7)
 > $Z≔\mathrm{RandomVariable}\left(\mathrm{Cauchy}\left(1,2\right)\right)$
 ${Z}{≔}{\mathrm{_R1}}$ (8)
 > $B≔\mathrm{Sample}\left({Y}^{2}+{Z}^{2},{10}^{5}\right)$
  (9)