Sampling from a discrete distribution, for a ParamFct or ParamLgl.

Format

R6::R6Class inheriting from Sampler1D.

Construction

smpl = Sampler1DCateg$new(param, prob = NULL)
  • param :: Param
    Domain / support of the distribution we want to sample from.

  • prob :: numeric()
    Numeric vector of param$nlevels probabilities, which is uniform by default.

Fields

See Sampler1D. Additionally, the class provides:

  • prob :: numeric(n)
    Numeric vector of param$nlevels probabilities, which is uniform by default.

Methods

See Sampler1D.

See also