Purpose of the goodness-of-fit tests is to compare fitted theoretical distribution with empirical distribution. Some tests compare theoretical and empirical (observed) frequencies of values belonging to specified class intervals, while other tests compare theoretical and empirical cumulative distribution functions.

**Chi-squared test. **This test compares theoretical and empirical (observed) frequencies. The control statistic of this test is:

where *f*_{e,k} is empirical frequency, *f*_{t,k} theoretical frequency, and *K* is the number of class intervals of the random variable. Statistic c^{2} folows the c^{2}-distribution with n = *K* – *r* – 1 degrees of freedom, where *r* is the number of parametars in theoretical distribution. The c^{2}-test is considered reliable if there is at least 5 intervals with at least 5 values in each.

The c^{2}-test is an one-sided test since the c^{2}-statistic can only take positive values. The c^{2}-statistic is compared with the critical value for a specified significance level a. If:

then the null hypothesis of the test can be adopted, i.e. the fit by the proposed theoretical distribution can be considered good.

Critical values of the c^{2}-statistics for different number of degrees of freedom and significance levels are given here.

**Kolmogorov-Smirnov test.** This non-parametric test compares theoretical and empirical cumulative distribution functions (c.d.f.). The control statistic is the largest difference between the two c.d.f.'s:

The null hypothesis of the test (good fit) can be adopted if D is not greater than the crticial value *D*_{N}:

Critical value *D*_{N} depends on sample size *N* and on significance level a (table is given here). Note that for large sample sizes there is an asympotic formula for *D*_{N} (last row in the table).

**Cramer-von Mises test. **The Cramer-von Mises test also compares theoretical and empirical cumulative distribution functions (c.d.f.). The control statistic of the test is defined as:

and essentally represents the sum of squared differences between the two c.d.f.'s. If the sample values are sorted in ascending order, and if empirical c.d.f. is represented by cumulative relative frequencies *F*_{e}(*x*_{i}) = *i*/*N*, then the above control statistic becomes:

In fact, this test uses statistic *N*w^{2} instead of w^{2}. Critical values of *N*w^{2} are given here.