View source: R/estimationfunctions.R
| epmf | R Documentation |
Calculate empirical probability mass function for a discrete positive distribution starting at 1
epmf(values)
values |
used for the calculation of the empirical pmf |
vector of probabilities for epmf for the range 1:length(values)
# generate random sample of independent draws from Poisson distribution
x <- rpois(200,4)
# calculate empirical probability mass function and true probability mass function
y.emp <- epmf(x)
y.theo <- dpois(1:max(x), 4)
plot(y.emp)
points(y.theo, col = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.