Overview - Maple Help

Estimation Commands

 The Statistics package supports a variety of tools for manipulating likelihood functions, performing maximum likelihood estimation and deriving various properties of the likelihood function.

Available Commands

 Fisher information statistical information estimate the probability density of a data set likelihood function compute the likelihood ratio statistic log likelihood function compute the maximum likelihood estimate statistical score

Examples

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

Calculate the likelihood, log likelihood and score function of a beta distribution

 > $\mathrm{Likelihood}\left('\mathrm{Β}'\left(a,b\right),A,\mathrm{samplesize}=1\right)$
 $\left\{\begin{array}{cc}{0}& {{A}}_{{1}}{<}{0}\\ \frac{{{A}}_{{1}}^{{-}{1}{+}{a}}{}{\left({1}{-}{{A}}_{{1}}\right)}^{{-}{1}{+}{b}}}{{\mathrm{Β}}{}\left({a}{,}{b}\right)}& {{A}}_{{1}}{<}{1}\\ {0}& {1}{\le }{{A}}_{{1}}\end{array}\right\$ (1)
 > $\mathrm{LogLikelihood}\left('\mathrm{Β}'\left(a,b\right),A,\mathrm{samplesize}=1\right)$
 ${\mathrm{ln}}{}\left(\frac{{{A}}_{{1}}^{{-}{1}{+}{a}}{}{\left({1}{-}{{A}}_{{1}}\right)}^{{-}{1}{+}{b}}}{{\mathrm{Β}}{}\left({a}{,}{b}\right)}\right)$ (2)
 > $\mathrm{Score}\left('\mathrm{Β}'\left(a,b\right),A,\mathrm{samplesize}=1\right)$
 $\left[\begin{array}{c}{\mathrm{ln}}{}\left({{A}}_{{1}}\right){-}{\mathrm{\Psi }}{}\left({a}\right){+}{\mathrm{\Psi }}{}\left({a}{+}{b}\right)\\ {\mathrm{ln}}{}\left({1}{-}{{A}}_{{1}}\right){-}{\mathrm{\Psi }}{}\left({b}\right){+}{\mathrm{\Psi }}{}\left({a}{+}{b}\right)\end{array}\right]$ (3)

Attempt to calculate the maximum likelihood estimate of a binomial distribution.

 > $S≔\mathrm{Sample}\left(\mathrm{Binomial}\left(10,0.4\right),1000\right)$
 ${S}{≔}\left[{7.}{,}{7.}{,}{2.}{,}{7.}{,}{7.}{,}{4.}{,}{5.}{,}{2.}{,}{4.}{,}{6.}{,}{5.}{,}{7.}{,}{5.}{,}{1.}{,}{6.}{,}{6.}{,}{5.}{,}{5.}{,}{5.}{,}{4.}{,}{5.}{,}{3.}{,}{5.}{,}{1.}{,}{3.}{,}{1.}{,}{2.}{,}{5.}{,}{5.}{,}{3.}{,}{7.}{,}{1.}{,}{4.}{,}{3.}{,}{5.}{,}{5.}{,}{3.}{,}{4.}{,}{4.}{,}{5.}{,}{5.}{,}{5.}{,}{3.}{,}{5.}{,}{5.}{,}{2.}{,}{2.}{,}{4.}{,}{7.}{,}{3.}{,}{4.}{,}{3.}{,}{5.}{,}{3.}{,}{4.}{,}{5.}{,}{6.}{,}{7.}{,}{4.}{,}{2.}{,}{2.}{,}{3.}{,}{6.}{,}{3.}{,}{5.}{,}{3.}{,}{6.}{,}{3.}{,}{3.}{,}{3.}{,}{4.}{,}{4.}{,}{3.}{,}{5.}{,}{4.}{,}{4.}{,}{6.}{,}{3.}{,}{5.}{,}{5.}{,}{3.}{,}{4.}{,}{2.}{,}{2.}{,}{4.}{,}{5.}{,}{6.}{,}{2.}{,}{4.}{,}{4.}{,}{1.}{,}{3.}{,}{2.}{,}{5.}{,}{3.}{,}{4.}{,}{2.}{,}{4.}{,}{3.}{,}{5.}{,}{\dots }{,}{\text{⋯ 900 row vector entries not shown}}\right]$ (4)
 > $\mathrm{MaximumLikelihoodEstimate}\left(\mathrm{Binomial}\left(10,\mathrm{\theta }\right),S,\mathrm{bounds}=0..1\right)$
 ${0.394899998859551}$ (5)

Calculate the same information about a normal distribution.

 > $\mathrm{Information}\left(\mathrm{Normal}\left(\mathrm{\mu },\mathrm{\sigma }\right),A,\mathrm{samplesize}=1,\mathrm{param}=\mathrm{\mu }\right)$
 ${-}\frac{{1}}{{{\mathrm{\sigma }}}^{{2}}}$ (6)
 > $\mathrm{FisherInformation}\left(\mathrm{Normal}\left(\mathrm{\mu },\mathrm{\sigma }\right),1,\mathrm{\mu }\right)$
 $\frac{{1}}{{{\mathrm{\sigma }}}^{{2}}}$ (7)

Compute the likelihood ratio statistic about a similar normal distribution.

 > $\mathrm{LikelihoodRatioStatistic}\left(\mathrm{Normal}\left(\mathrm{\mu },5\right),A,\mathrm{samplesize}=1\right)$
 $\frac{{1}}{{25}}{}{{A}}_{{1}}^{{2}}{-}\frac{{2}}{{25}}{}{{A}}_{{1}}{}{\mathrm{\mu }}{+}\frac{{1}}{{25}}{}{{\mathrm{\mu }}}^{{2}}$ (8)