aa <- 1:10
(pp <- pzipfmb(aa, shape = 0.5, start = 1))
cumsum(dzipfmb(aa, shape = 0.5, start = 1)) # Should be same
qzipfmb(pp, shape = 0.5, start = 1) - aa # Should be all 0s
rdiffzeta(30, 0.5)
if (FALSE) x <- 1:10
plot(x, dzipfmb(x, shape = 0.5), type = "h", ylim = 0:1,
sub = "shape=0.5", las = 1, col = "blue", ylab = "Probability",
main = "Zipf-Mandelbrot distribution: blue=PMF; orange=CDF")
lines(x+0.1, pzipfmb(x, shape = 0.5), col = "red", lty = 3, type = "h")
Run the code above in your browser using DataLab