Skip to contents

A discrete measure on finitely many parameter atoms; the shape of \(\widehat{W}_0\).

print() shows the atoms and their weights as a table when there are at most eight, and the atom count with the heaviest atom otherwise; atoms() and weights() give the full support either way.

Usage

finite_dist(atoms = NULL, weights = integer(0))

Arguments

atoms

(C, d) numeric matrix, one parameter vector (atom) per row.

weights

Length-C numeric vector summing to 1.

Value

A finite_dist.

Examples

d <- finite_dist(
  atoms = rbind(c(0.6, 0.2, 0.2), c(0.2, 0.6, 0.2)),
  weights = c(0.5, 0.5)
)
n_atoms(d)
#> [1] 2
atoms(d)
#>      [,1] [,2] [,3]
#> [1,]  0.6  0.2  0.2
#> [2,]  0.2  0.6  0.2
weights(d)
#> [1] 0.5 0.5