Student/Statistics/ChiSquareSuitableModelTest/overview - Maple Help

Student[Statistics][ChiSquareSuitableModelTest] Overview

overview of the chi-square suitable model test

Description

 • Chi-Squared Suitable Model Test is used to determine if the sample gathered might have been drawn from the distribution specified. For example, it can be used to test if the time gap between cars driving by a road follows Poisson distribution. This test is a special case of the Chi-Squared Goodness of Fit Test. The observations in the sample are tallied into bins; then the number of observations in the $i$th bin is compared with the expected number. The bins option determines the number of bins that the sample is tallied into; it is explained in greater detail in the help page of Statistics[ChiSquareSuitableModelTest].
 • This test is only appropriate if there is a 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.
 • Requirements for using Chi-Squared Suitable Model Test:
 1 The goal is to test if the sample gathered fits the expected distribution.
 • The formula is:

${X}^{2}=\sum _{i=1}^{N}\frac{{\left({\mathrm{observed}}_{i}-{\mathrm{expected}}_{i}\right)}^{2}}{{\mathrm{expected}}_{i}}$

 where $\mathrm{observed}$ and $\mathrm{expected}$ are the data in the observed sample and the expected sample respectively, $N$: The number of bins that the sample is tallied into, and ${X}^{2}$ follows a Chi-Squared distribution with $N-1$ degrees of freedom.

Example

Suppose a sample of data is given by $\left[-3.5,1.7,-0.3,5.5,3.8,16.1,-7.4,15.0,5.2,11.0\right]$. We want to test if this data fits $\mathrm{Normal}\left(4,7\right)$.

 1 Determine the null hypothesis:
 Null Hypothesis: The observed sample fits $\mathrm{Normal}\left(4,7\right)$.
 2 Determine the bins we will use for this test:
 Maple will automatically determine the reasonable bins used. For this case, there are 4 bins and they are $-\mathrm{\infty }..-0.721,-0.721..4,4..8.721,8.721..\mathrm{\infty }$.
 3 Count the number of data points in the observed sample and the expected number of data points that fall in the ith bin:
 $N˜\mathrm{Normal}\left(4,7\right)$

 Bin Observed Expected $-\mathrm{\infty }..-0.721$ 2 $10\mathrm{Probability}\left(\mathrm{-infinity < N < -0.721}\right)=2.500$ $-0.721..4$ 3 $10\mathrm{Probability}\left(\mathrm{-0.721 < N < 4}\right)=2.500$ $4..8.721$ 2 $10\mathrm{Probability}\left(\mathrm{4 < N < 8.721}\right)=2.500$ $8.721..\mathrm{\infty }$ 3 $10\mathrm{Probability}\left(\mathrm{8.721 < N < infinity}\right)=2.500$

 • Substitute the information into the formula:
 $t$ = $\frac{{\left(2-2.500\right)}^{2}}{2.500}+\frac{{\left(3-2.500\right)}^{2}}{2.500}+\frac{{\left(2-2.500\right)}^{2}}{2.500}+\frac{{\left(3-2.500\right)}^{2}}{2.500}$ =0.400
 4 Compute the p-value:
 p-value = $\mathrm{Probability}\left({X}^{2}<0.400\right)$ = 0.940, where ${X}^{2}˜\mathrm{ChiSquare}\left(3\right)$.
 5 Draw the conclusion:
 This statistical test does not provide enough evidence to conclude that the null hypothesis is false, so we fail to reject the null hypothesis.