dhzeta(1:20, 2.1)
rhzeta(20, 2.1)
round(1000 * dhzeta(1:8, 2))
table(rhzeta(1000, 2))
alpha <- 1.1; x <- 1:10
plot(x, dhzeta(x, alpha = alpha), type = "h", ylim = 0:1, lwd = 2,
sub = paste("alpha =", alpha), las = 1, col = "blue", ylab = "Probability",
main = "Haight's zeta: blue = density; red = distribution function")
lines(x+0.1, phzeta(x, alpha = alpha), col = "red", lty = 3, lwd = 2, type = "h")
Run the code above in your browser using DataLab