# NOT RUN {
N <- 10; shape <- 1.5; pstr1 <- 0.3; x <- (-1):N
(ii <- doizipf(x, N, shape, pstr1 = pstr1))
# }
# NOT RUN {
x <- 0:10
par(mfrow = c(2, 1)) # One-Inflated zipf
barplot(rbind(doizipf(x, N, shape, pstr1 = pstr1), dzipf(x, N, shape)),
beside = TRUE, col = c("blue", "orange"),
main = paste("OIZipf(", N, ", ", shape, ", pstr1 = ", pstr1, ") (blue) vs",
" Zipf(", N, ", ", shape, ") (orange)", sep = ""),
names.arg = as.character(x))
deflat.limit <- -dzipf(1, N, shape) / (1 - dzipf(1, N, shape))
newpstr1 <- round(deflat.limit, 3) + 0.001 # Inside but near the boundary
barplot(rbind(doizipf(x, N, shape, pstr1 = newpstr1),
dzipf(x, N, shape)),
beside = TRUE, col = c("blue", "orange"),
main = paste("ODZipf(", N, ", ", shape, ", pstr1 = ", newpstr1, ") (blue) vs",
" Zipf(", N, ", ", shape, ") (orange)", sep = ""),
names.arg = as.character(x))
# }
Run the code above in your browser using DataLab