8
$\begingroup$

NOTE: I purposely did not label the axis due to pending publications. The line colors represent the same data in all three plots.
I fitted my data using a negative binomial distribution to generate a pdf. I am happy with the pdf and meets my research needs. PDF plot:

alt text


For when reporting the CDF, should I use the empirical or fitted CDF? There are slight differences between the empirical and fitted CDF, specifically at x = 40, the yellow and cyan lines intersect in the empirical distribution, but not the fitted.

Empirical:
alt text

Negative Binomial CDF: alt text

$\endgroup$
5
  • $\begingroup$ Why do you need to report CDF (empirical or estimated) when you are happy with the PDF? $\endgroup$
    – suncoolsu
    Commented Jan 16, 2011 at 21:15
  • $\begingroup$ @Suncoolsu, statement of work requires both $\endgroup$ Commented Jan 16, 2011 at 21:26
  • $\begingroup$ Also I think it is a good question regarding if people should use empirical or fitted cdfs. $\endgroup$ Commented Jan 16, 2011 at 21:26
  • $\begingroup$ I would go for consistency, if the pdf is fitted, then cdf should be fitted, if pdf is empirical, so is the cdf. $\endgroup$
    – mpiktas
    Commented Jan 17, 2011 at 7:09
  • $\begingroup$ Consistency is nice, however if you using the empirical cdf, you can provide support (or argue against) your choice of distribution in the pdf $\endgroup$ Commented Jan 17, 2011 at 17:14

2 Answers 2

5
$\begingroup$

Personally, I'd favour instead showing the fit of the theoretical to the empirical distribution using a set of P-P plots or Q-Q plots.

$\endgroup$
3
  • $\begingroup$ Can I use a Q-Q plot instead? I am currently using Matlab and they have a built-in function for Q-Q plots (qqplot) but not R-R plots. $\endgroup$ Commented Jan 17, 2011 at 3:09
  • 2
    $\begingroup$ @Elpezmuerto. Yes pp plot and qqplot try to do the same job. I think QQ plot is as good as PP plot (with subtle differences). But as the great Cleveland, W.S. says, QQ plot is one of the best ways to compare distributions. $\endgroup$
    – suncoolsu
    Commented Jan 17, 2011 at 5:00
  • $\begingroup$ Yes, a Q-Q plot would be fine too. Late last night I had some half-formed idea that a P-P plot would be a bit better in this case, but I've changed my mind in the cold light of morning so edited my answer to reflect this. $\endgroup$
    – onestop
    Commented Jan 17, 2011 at 11:18
3
$\begingroup$

The empirical CDF needs to be treated with care at the end points of the data, and in other places where there is "sparse" data. This is because they tend to make weak structural assumptions about what goes on "in between" each data point. It would also be a good idea to have "dots" for the empirical CDF plot rather than lines, or have the dots superimposed over the lines, so that it is easier to see where most of the data actually is. Another alternative is to put the "dots" for the data over the fitted CDF plot, although there may be too much going on in the plot.

Maybe its a plotting difficulty, but the empirical CDF should look like a staircase or step function (horizontal lines with "jumps" at the observed values). The empirical plots above do not look this way, they appear "smoothed". Maybe they are a "non-parametric" CDF using some kind of plot smoother?

If it is a "non-parametric" CDF then you are basically comparing between to models: the negative binomial and the non-parametric one.

My advice: have a separate plot for each data (each colour on a new graph), and then put the empirical CDF as "dots" where the data was observed, and the fitted negative binomial CDF as a smooth line on the same plot. This would look similar to a regression-style scatter plot with a fitted line. An example of the kind of plot I am talking (which has R-code to create it) is here How to present the gain in explained variance thanks to the correlation of Y and X?)

$\endgroup$
4
  • $\begingroup$ I used this Matlab function to generate the empirical cdf: mathworks.com/matlabcentral/fileexchange/4426-cdfplot $\endgroup$ Commented Jan 18, 2011 at 14:54
  • $\begingroup$ Great advice, especially about overlaying the dots on the line plots. $\endgroup$ Commented Jan 18, 2011 at 15:19
  • $\begingroup$ Maybe its got something to do with the graphics on my PC or this web page, but the plots in the link do look like stair-case functions, but the plots in the question look smooth. Maybe you have a lot of data and the "steps" are so close together you can't see them? $\endgroup$ Commented Jan 18, 2011 at 15:35
  • $\begingroup$ you would be correct, my posted figure is also from pgfplots to make it look pretty for the report $\endgroup$ Commented Jan 18, 2011 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.