Learn R Programming

prevtoinc (version 0.12.0)

epmf: Calculate empirical probability mass function for a discrete positive distribution starting at 1

Description

Calculate empirical probability mass function for a discrete positive distribution starting at 1

Usage

epmf(values)

Arguments

values

used for the calculation of the empirical pmf

Value

vector of probabilities for epmf for the range 1:length(values)

Examples

Run this code
# NOT RUN {
# 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")

# }

Run the code above in your browser using DataLab