The chi-square goodness of fit test