Skip to contents

Blended distribution

Usage

dist_blended(dists, probs = NULL, breaks = NULL, bandwidths = NULL)

Arguments

dists

A list of k >= 2 component Distributions.

probs

k Mixture weight parameters

breaks

k - 1 Centers of the blending zones. dists[i] will blend into dists[i + 1] around breaks[i].

bandwidths

k - 1 Radii of the blending zones. The i-th blending zone will begin at breaks[i] - bandwidths[i] and end at breaks[i] + bandwidths[i]. A bandwidth of 0 corresponds to a hard cut-off, i.e. a jump discontinuity in the density of the blended Distribution.

Value

A BlendedDistribution object.

Examples

bd <- dist_blended(
  list(
    dist_normal(mean = 0.0, sd = 1.0),
    dist_genpareto(u = 3.0, sigmau = 1.0, xi = 3.0)
  ),
  breaks = list(3.0),
  bandwidths = list(0.5),
  probs = list(0.9, 0.1)
)

plot_distributions(
  bd,
  .x = seq(-3, 10, length.out = 100),
  plots = c("d", "p")
)