1.3.5.15. Chi-Square Goodness-of-Fit Test

To compute the test statistic used in the chi-square goodness-of-fit test, one first partitions the range of possible observed values of the quantity of interest, \( Y \), into \( k \) bins determined by \( y_{1} < y_{2} < \dots < y_{k+1} \), such that bin \( i \) has lower endpoint \( y_{i} \) and upper endpoint \( y_{i+1} \) for \( i=1,\dots,k \). Note that \( y_{1} \) can be \( -\infty \) and \( y_{k+1} \) can be \( +\infty \).

The test statistic is defined as \( \begin{equation*} \chi^{2} = \sum_{i=1}^{k} (O_{i}-E_{i})^{2}/E_{i} \end{equation*} \) where \( O_{i} \) denotes the number of observations that fall in bin \( i \) (under some convention for how to count observations that fall on the boundary between two consecutive bins: for example, that an observation equal to \( y_{i} \) is counted as being in bin \( i+1 \)), and \( E_{i} \) denotes the number of observations expected to fall in bin \( i \) based on the probability model under test. If this model is specified in terms of its cumulative distribution function, \( F_{\theta} \), then the expected counts are computed as \( \begin{equation*} E_{i} = N (F_{\theta}(y_{i+1})-F_{\theta}(y_{i}). \end{equation*} \) where \( N \) denotes the sample size, and under the convention that \( F_{\theta}(-\infty) = 0 \) and \( F_{\theta}(+\infty) = 1 \).

Note that, in general, this cumulative distribution function depends on a possibly vectorial parameter, \( \theta \), hence the notation \( F_{\theta} \) in the foregoing equation for \( E_{i} \). For example, if the probability model is Gaussian, then \( \theta = (\mu, \sigma) \), where \( \mu \) and \( \sigma \) denote the mean and standard deviation of the Gaussian distribution. However, if the probability model is Poisson, then \( \theta \) is a scalar, \( \theta = \lambda \), the corresponding mean. In any case, to be able to compute \( E_{i} \) one needs first to estimate \( \theta \).

The chi-square test assumes that the estimate of \( \theta \) is the maximum likelihood estimate derived from the observed bin counts, not from the individual observations. Such estimate, which we denote \( \widetilde{\theta} \), can be computed by numerical maximization of the log-likelihood function, \( \ell \), with respect to \( \theta \): \( \begin{equation*} \ell(\theta) = \sum_{i=1}^{k} O_{i} \log (F_{\theta}(y_{i+1})-F_{\theta}(y_{i})). \end{equation*} \) The expected bin counts are then computed as \( E_{i} = N (F_{\widetilde{\theta}}(y_{i+1})- F_{\widetilde{\theta}}(y_{i}) \) for \( i=1,\dots,k \).

Từ khóa » H0 Chi2