Skip to contents

Atoms are pruned by weight only, never merged, so survivors may still coincide in parameter space.

Usage

prune(x, threshold = 1e-08)

Arguments

x

A finite_dist.

threshold

Atoms with weight <= threshold are dropped.

Value

A finite_dist over the survivors.

Examples

w <- finite_dist(
  atoms = rbind(c(0.6, 0.4), c(0.2, 0.8), c(0.5, 0.5)),
  weights = c(0.98, 0.01, 0.01)
)
prune(w, threshold = 0.05)
#> <finite_dist>
#>   1 atom in R^2
#>      theta1 theta2 weight
#> [1,]    0.6    0.4      1