Description Usage Arguments References Examples
Density, distribution function, quantile function and random generation for the truncated Poisson distribution.
1 2 3 4 5 6 7 |
x, q |
vector of quantiles. |
lambda |
vector of (non-negative) means. |
a, b |
lower and upper truncation points ( |
log, log.p |
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X ≤ x] otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. If |
Plackett, R.L. (1953). The truncated Poisson distribution. Biometrics, 9(4), 485-488.
Singh, J. (1978). A characterization of positive Poisson distribution and its statistical application. SIAM Journal on Applied Mathematics, 34(3), 545-548.
Dalgaard, P. (May 1, 2005). [R] simulate zero-truncated Poisson distribution. R-help mailing list. https://stat.ethz.ch/pipermail/r-help/2005-May/070680.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | x <- rtpois(1e5, 14, 16)
xx <- seq(-1, 50)
plot(prop.table(table(x)))
lines(xx, dtpois(xx, 14, 16), col = "red")
hist(ptpois(x, 14, 16))
xx <- seq(0, 50, by = 0.01)
plot(ecdf(x))
lines(xx, ptpois(xx, 14, 16), col = "red", lwd = 2)
uu <- seq(0, 1, by = 0.001)
lines(qtpois(uu, 14, 16), uu, col = "blue", lty = 2)
# Zero-truncated Poisson
x <- rtpois(1e5, 5, 0)
xx <- seq(-1, 50)
plot(prop.table(table(x)))
lines(xx, dtpois(xx, 5, 0), col = "red")
hist(ptpois(x, 5, 0))
xx <- seq(0, 50, by = 0.01)
plot(ecdf(x))
lines(xx, ptpois(xx, 5, 0), col = "red", lwd = 2)
lines(qtpois(uu, 5, 0), uu, col = "blue", lty = 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.