A full-flexibility discrete distribution with values from 1 to size
.
Arguments
- size
Number of classes parameter (integer). Required if
probs
isNULL
.- probs
Vector of probabilties parameter, or
NULL
as a placeholder.
See also
Other Distributions:
Distribution
,
dist_bdegp()
,
dist_beta()
,
dist_binomial()
,
dist_blended()
,
dist_dirac()
,
dist_empirical()
,
dist_erlangmix()
,
dist_exponential()
,
dist_gamma()
,
dist_genpareto()
,
dist_lognormal()
,
dist_mixture()
,
dist_negbinomial()
,
dist_normal()
,
dist_pareto()
,
dist_poisson()
,
dist_translate()
,
dist_trunc()
,
dist_uniform()
,
dist_weibull()
Examples
d_discrete <- dist_discrete(probs = list(0.5, 0.25, 0.15, 0.1))
x <- d_discrete$sample(100)
d_emp <- dist_empirical(x)
plot_distributions(
empirical = d_emp,
theoretical = d_discrete,
estimated = d_discrete,
with_params = list(
estimated = list(
size = max(x),
probs = as.list(unname(table(x)) / 100)
)
),
.x = 0:max(x)
)