Parameters of mixing components can be overridden with
with_params = list(dists = list(..., ..., ...))
.
#' Mixing probabilites can be overridden with
with_params = list(probs = list(..., ..., ...))
.
The number of components cannot be overridden.
Usage
dist_mixture(dists = list(), probs = NULL)
Arguments
- dists
A list of mixing distributions. May contain placeholders and duplicates.
- probs
A list of mixing probabilities with the same length as
dists
. They are normalized to sum to one andNULL
can be used as a placeholder within probs. To reduce the number of required parameters, probs should at least be partly specified (probs = list(NULL, NULL, ..., 1)
with k - 1NULL
s where k is the number of mixing components).
Details
Does not support the quantile()
capability!
See also
Other Distributions:
Distribution
,
dist_bdegp()
,
dist_beta()
,
dist_binomial()
,
dist_blended()
,
dist_dirac()
,
dist_discrete()
,
dist_empirical()
,
dist_erlangmix()
,
dist_exponential()
,
dist_gamma()
,
dist_genpareto()
,
dist_lognormal()
,
dist_negbinomial()
,
dist_normal()
,
dist_pareto()
,
dist_poisson()
,
dist_translate()
,
dist_trunc()
,
dist_uniform()
,
dist_weibull()
Examples
# A complicated way to define a uniform distribution on \[0, 2\]
dist_mixture(
dists = list(
dist_uniform(min = 0, max = 1),
dist_uniform(min = 1, max = 2)
),
probs = list(0.5, 0.5)
)
#> A Mixture<UniformDistribution, UniformDistribution> with 0 dof