# Sample some data:
y = rpois(n = 500, lambda = 5)
# Empirical CDF version:
g_np = g_cdf(y, distribution = 'np')
# Poisson version:
g_pois = g_cdf(y, distribution = 'pois')
# Negative binomial version:
g_negbin = g_cdf(y, distribution = 'neg-bin')
# Plot together:
t = 1:max(y) # grid
plot(t, g_np(t), type='l')
lines(t, g_pois(t), lty = 2)
lines(t, g_negbin(t), lty = 3)
Run the code above in your browser using DataLab