LikelihoodRatioStatistic - Maple Help

Statistics

 LikelihoodRatioStatistic
 compute the likelihood ratio statistic

 Calling Sequence LikelihoodRatioStatistic(R, V, options)

Parameters

 R - algebraic; a random variable or distribution V - rtable; data sample options - (optional) equation(s) of the form option=value where option is one of bounds, samplesize, params, ignore or weights; specify options for the LikelihoodRatioStatistic function

Description

 • The LikelihoodRatioStatistic function computes the likelihood ratio statistic of a random variable R evaluated on a dataset V.
 • The first parameter R can be a distribution (see Statistics[Distribution]), a random variable, or an algebraic expression involving random variables (see Statistics[RandomVariable]).
 • The second parameter V can be an Array of data samples or a symbol representing an Array of data samples (in which case the option samplesize must be specified).

Options

 The options argument can contain one or more of the options shown below.
 • samplesize = deduce or posint -- If set to 'deduce' (default) the function attempts to automatically determine the number of data samples provided in V.  This parameter must be specified if the number of samples in V is not immediately detectable.
 • bounds = none or range -- If this option specifies a range, then the function will attempt to calculate the maximum likelihood estimate within the given bounds when constructing the likelihood ratio statistic.  Otherwise the function will attempt to calculate the maximum likelihood estimate over the entire real line (default).
 • params = list(name=realcons) -- This option specifies parameters that should be evaluated prior to calculating the likelihood ratio statistic.  This function will only work if exactly one indeterminate is present in the final expression - hence all remaining indeterminates must be evaluated prior to generating the final expression.
 • ignore = truefalse -- This option is used to specify how to handle non-numeric data. If ignore is set to true all non-numeric items in V will be ignored.
 • weights = rtable -- Vector of weights (one-dimensional rtable). If weights are given, the LikelihoodRatioStatistic function will scale each data point to have given weight. Note that the weights provided must have type realcons and the results are floating-point, even if the problem is specified with exact values. Both the data array and the weights array must have the same number of elements.

Notes

 • Note that for numeric solutions this function uses NLPSolve which is not sensitive to assumptions made with the assume command.  For symbolic solutions this function uses solve instead and ignores the bounds option.

Examples

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

Calculate the likelihood ratio statistic of a general sample over a Binomial distribution.

 > $\mathrm{LikelihoodRatioStatistic}\left(\mathrm{Binomial}\left(10,\mathrm{\theta }\right),A,\mathrm{samplesize}=1\right)$
 ${2}{}{\mathrm{ln}}{}\left(\left(\genfrac{}{}{0}{}{{10}}{{{A}}_{{1}}}\right){}{{10}}^{{-}{{A}}_{{1}}}{}{{A}}_{{1}}^{{{A}}_{{1}}}{}{\left({1}{-}\frac{{{A}}_{{1}}}{{10}}\right)}^{{10}{-}{{A}}_{{1}}}\right){-}{2}{}{\mathrm{ln}}{}\left(\left(\genfrac{}{}{0}{}{{10}}{{{A}}_{{1}}}\right){}{{\mathrm{\theta }}}^{{{A}}_{{1}}}{}{\left({1}{-}{\mathrm{\theta }}\right)}^{{10}{-}{{A}}_{{1}}}\right)$ (1)

Perform the same calculation except with a provided sample.

 > $S≔\mathrm{Sample}\left(\mathrm{Binomial}\left(10,0.4\right),1000\right):$
 > $\mathrm{LikelihoodRatioStatistic}\left(\mathrm{Binomial}\left(10,\mathrm{\theta }\right),S,\mathrm{bounds}=0..1\right)$
 ${-}{13406.6240486848}{-}{12128.}{}{\mathrm{ln}}{}\left({1.}{-}{\mathrm{\theta }}\right){-}{7872.}{}{\mathrm{ln}}{}\left({\mathrm{\theta }}\right)$ (2)

Attempt to compute the likelihood ratio statistic of the standard deviation of a normal distribution.

 > $\mathrm{assume}\left(0<\mathrm{\sigma }\right)$
 > $\mathrm{LikelihoodRatioStatistic}\left(\mathrm{Normal}\left(0,\mathrm{\sigma }\right),A,\mathrm{samplesize}=2\right)$
 ${-}\frac{{2}{}{\mathrm{ln}}{}\left({{A}}_{{1}}^{{2}}{+}{{A}}_{{2}}^{{2}}\right){}{{\mathrm{σ~}}}^{{2}}{-}{4}{}{\mathrm{ln}}{}\left({\mathrm{σ~}}\right){}{{\mathrm{σ~}}}^{{2}}{-}{2}{}{\mathrm{ln}}{}\left({2}\right){}{{\mathrm{σ~}}}^{{2}}{+}{2}{}{{\mathrm{σ~}}}^{{2}}{-}{{A}}_{{1}}^{{2}}{-}{{A}}_{{2}}^{{2}}}{{{\mathrm{σ~}}}^{{2}}}$ (3)