prob <- 0.35; pobs0 <- 0.05; x <- (-1):7
dzageom(x, prob = prob, pobs0 = pobs0)
table(rzageom(100, prob = prob, pobs0 = pobs0))
if (FALSE) x <- 0:10
barplot(rbind(dzageom(x, prob = prob, pobs0 = pobs0),
dgeom(x, prob = prob)), las = 1,
beside = TRUE, col = c("blue", "orange"), cex.main = 0.7,
ylab = "Probability", names.arg = as.character(x),
main = paste("ZAG(prob = ", prob, ", pobs0 = ", pobs0,
") [blue] vs", " Geometric(prob = ", prob,
") [orange] densities", sep = ""))
Run the code above in your browser using DataLab