Skip to contents

The ddf Class

ddf-class
An S4 class to represent a discrete distribution with finite support
ddf()
Create new ddf objects
ddf_from_frequencies()
Create new ddf objects from absolute frequencies
supp()
Get the support of a ddf object
probs()
Get the probabilities of a ddf object
desc()
Get the description of a ddf object
`desc<-`()
Set the description of a ddf object
`-`(<ddf>,<missing>)
Multiply the support of a distribution with -1
shift()
Shift a distribution

Common Discrete Distributions

Distributions with Finite Support

benford()
Benford's law
bernoulli()
The Bernoulli distribution
beta_binomial()
The beta-binomial distribution
bin()
The binomial distribution
hypergeometric()
The hypergeometric distribution
negative_hypergeometric()
The negative hypergeometric distribution
rademacher()
The Rademacher distribution
unif()
The discrete uniform distribution
zipf()
The Zipf distribution

Distributions with Countably Infinite Support

geometric()
The geometric distribution
negative_bin()
The negative binomial distribution
pois()
The Poisson distribution

Analysing Properties of Distributions

Central Tendency

expected_value() mean(<ddf>)
Calculate the expected value of distributions
medians()
Calculate medians of distributions
modes()
Calculate modes of distributions

Dispersion

standard_deviation()
Calculate the standard deviation of distributions
variance()
Calculate the variance of distributions
iqr()
Calculate the interquartile range of distributions
distribution_range()
Calculate the range of distributions

Moments

central_moment()
Calculate central moments of distributions
moment()
Calculate moments of distributions
standardized_moment()
Calculate standardized moments of distributions
skew()
Calculate the skewness of distributions
kurtosis()
Calculate the kurtosis of distributions
excess_kurtosis()
Calculate the excess kurtosis of distributions

Quantiles

decile()
Calculate deciles of distributions
percentile()
Calculate percentiles of distributions
quantiles()
Calculate quantiles of distributions
quartile()
Calculate quartiles of distributions

Other

entropy()
Calculate the entropy of distributions
report()
Generate a report for a distribution

Creating New Objects from Distributions

pmf()
Probability mass function
cdf()
Cumulative distribution function
samples()
Random samples from a distribution

Plotting

plot(<ddf>,<missing>)
Plot a distribution
plot_cdf()
Plot the CDF of a distribution
plot_pmf()
Plot the PMF of a distribution

Convolutions

conv() `*`(<ddf>,<ddf>)
Convolve two discrete distributions
conv_n()
Calculate the n-fold convolution of a distribution with itself
convolve_cpp()
Convolve two discrete distributions