Suppose one has data that is suspected to obey a normal distribution. One computes a histogram of the data, and performs Pearson's Chi-Squared Test. To perform this test, one must compare the observed counts from each bin in the histogram against the expected counts in the corresponding bins by the formula below:
To compute the expected counts, one integrates the probability density function of the normal distribution from the left bin-edge to the right bin-edge for all bins using fixed parameters mu and sigma. The smallest Chi-Squared statistic (assuming the associated pvalue is not too high or too low) should correspond to the fixed parameters that best fit the data.
(If anything is incorrect, please correct me).
I have read that a better optimization technique is to use the cdf instead of the pdf. If one still wanted to use the cdf (instead of the pdf) in conjunction with Pearson's Chi-Squared Test to optimize the distribution fit, how would one go about this?
My initial thought is that the histogram of observations should be converted into a cumulative histogram, such that the expected counts can be obtained from the integration of the cdf instead of the pdf. Is this wrong?
(I am asking because I have a lognormal dataset; the Chi-Square fit of looks great but the pvalue is small enough to be approximated as zero. Any advice or corrections regarding misunderstood information would be appreciated).