prob <- 0.35; pobs0 <- 0.05; x <- (-1):7
dzageom(x, prob = prob, pobs0 = pobs0)
table(rzageom(100, prob = prob, pobs0 = pobs0))
x <- 0:10
barplot(rbind(dzageom(x, prob = prob, pobs0 = pobs0),
dgeom(x, prob = prob)),
beside = TRUE, col = c("blue", "orange"), cex.main = 0.7, las = 1,
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