ChiSquareSuitableModelTest - Maple Help

Student[Statistics]

 ChiSquareSuitableModelTest
 apply the chi-square suitable model test

 Calling Sequence ChiSquareSuitableModelTest(X, F, options)

Parameters

 X - observed data sample F - function, algebraic; probability distribution or random variable to match data against options - (optional) equation(s) of the form option=value where option is one of bins, level, output, or range; specify options for the ChiSquareSuitableModelTest function

Description

 • The ChiSquareSuitableModelTest function performs the chi-square suitable model test upon an observed data sample against a known random variable or probability distribution. It works by determining bins for a histogram from the probability distribution, then classifying the entries of X into these bins, and finally testing whether the resulting histogram matches the histogram for the probability distribution.
 • The first parameter X is a data sample of observed data to use in the analysis.
 • The second parameter F is a random variable or probability distribution that is compared to the observed data sample.
 • This test is only appropriate if there is prior knowledge of any parameters in the distribution. If any of the parameters in the distribution have been fitted to the data sample in question, then an adjustment of the degrees-of-freedom parameter is necessary. This adjustment is not available in the current implementation.

Options

 The options argument can contain one or more of the options shown below.
 • bins='deduce' or posint
 This option indicates the number of bins to use when categorizing data from X and probabilities from F.  If set to 'deduce' (default), the function attempts to determine a reasonable value for this option. This parameter is ignored if the distribution is discrete.
 • range='deduce' or range
 This option indicates the range to use when considering data values - data outside of the range is discarded during processing.  If set to 'deduce' (default), the function attempts to determine a suitable range.
 • level=float
 This option is used to specify the level of the analysis (minimum criteria for the observed data to be considered well-fit to the expected data).  By default, this value is 0.05.
 • output=report or plot or both
 If the option output is not included or is specified to be output=report, then the function will return a report. If output=plot is specified, then the function will return a plot of the sample test. If output=both is specified, then both the report and the plot will be returned.

Examples

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

Initialize an array of data

 > $X≔\mathrm{Sample}\left(\mathrm{NormalRandomVariable}\left(0,1\right),100\right):$

Perform the suitable model test upon this sample.

 > $\mathrm{ChiSquareSuitableModelTest}\left(X,\mathrm{UniformRandomVariable}\left(0,1\right),\mathrm{bins}=10\right)$
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution   Bins:                    10 Degrees of Freedom:      9 Distribution:            ChiSquare(9) Computed Statistic:      301.6000000 Computed p-value:        0. Critical Values:         16.9189774487099   Result: [Rejected] This statistical test provides evidence that the null hypothesis is false.
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{false}}{,}{\mathrm{criticalvalue}}{=}{16.9189774487099}{,}{\mathrm{distribution}}{=}{\mathrm{ChiSquare}}{}\left({9}\right){,}{\mathrm{pvalue}}{=}{0.}{,}{\mathrm{statistic}}{=}{301.6000000}\right]$ (1)
 > $\mathrm{ChiSquareSuitableModelTest}\left(X,\mathrm{NormalRandomVariable}\left(0,1\right),\mathrm{bins}=10\right)$
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution   Bins:                    10 Degrees of Freedom:      9 Distribution:            ChiSquare(9) Computed Statistic:      14.80000000 Computed p-value:        .0965781731648307 Critical Values:         16.9189774487099   Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false.
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{true}}{,}{\mathrm{criticalvalue}}{=}{16.9189774487099}{,}{\mathrm{distribution}}{=}{\mathrm{ChiSquare}}{}\left({9}\right){,}{\mathrm{pvalue}}{=}{0.0965781731648307}{,}{\mathrm{statistic}}{=}{14.80000000}\right]$ (2)

If the output=plot option is included, then a report will be returned.

 > $\mathrm{ChiSquareSuitableModelTest}\left(X,\mathrm{NormalRandomVariable}\left(0,1\right),\mathrm{bins}=10,\mathrm{output}=\mathrm{plot}\right)$

If the output=both option is included, then both a report and a plot will be returned.

 > $\mathrm{report},\mathrm{graph}≔\mathrm{ChiSquareSuitableModelTest}\left(X,\mathrm{NormalRandomVariable}\left(0,1\right),\mathrm{bins}=10,\mathrm{output}=\mathrm{both}\right):$
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution   Bins:                    10 Degrees of Freedom:      9 Distribution:            ChiSquare(9) Computed Statistic:      14.80000000 Computed p-value:        .0965781731648307 Critical Values:         16.9189774487099   Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false. Histogram Type:  default Data Range:      -1.6348567543439 .. 2.21337958939036 Bin Width:       .128274544791142 Number of Bins:  30 Frequency Scale: relative
 > $\mathrm{report}$
 $\left[{\mathrm{hypothesis}}{=}{\mathrm{true}}{,}{\mathrm{criticalvalue}}{=}{16.9189774487099}{,}{\mathrm{distribution}}{=}{\mathrm{ChiSquare}}{}\left({9}\right){,}{\mathrm{pvalue}}{=}{0.0965781731648307}{,}{\mathrm{statistic}}{=}{14.80000000}\right]$ (3)
 > $\mathrm{graph}$

References

 Kanju, Gopal K. 100 Statistical Tests. London: SAGE Publications Ltd., 1994.
 Sheskin, David J. Handbook of Parametric and Nonparametric Statistical Procedures. London: CRC Press, 1997.

Compatibility

 • The Student[Statistics][ChiSquareSuitableModelTest] command was introduced in Maple 18.