Skip to contents

Returns an DIRICHLET distribution object that draw random numbers generated by the function rdirichlet

Usage

new_DIRICHLET(p_alpha, p_dimnames)

Arguments

p_alpha

k-value vector for concentration parameter. Must be positive

p_dimnames

A vector of characters for the names of the k-dimensions

Value

An object of class DISTRIBUTION, p_distribution$distribution, TRUNCATED

Details

A name can be provided for the dimensions. Otherwise rvar1, rvar2, ..., rvark will be assigned

Author

John J. Aponte

Examples

myDistr <- new_DIRICHLET(c(0.3,0.2,0.5), c("a","b","c"))
myDistr$rfunc(10)
#>                  a            b           c
#>  [1,] 5.557749e-02 1.460798e-02 0.929814525
#>  [2,] 1.163197e-01 1.942130e-02 0.864259011
#>  [3,] 9.834745e-01 1.012815e-02 0.006397327
#>  [4,] 2.807500e-04 4.773452e-01 0.522374066
#>  [5,] 3.852842e-01 5.584088e-01 0.056306988
#>  [6,] 4.872164e-01 6.065056e-05 0.512722928
#>  [7,] 1.589457e-05 3.504001e-02 0.964944098
#>  [8,] 3.879569e-01 1.898114e-01 0.422231734
#>  [9,] 3.179918e-01 6.638312e-01 0.018176993
#> [10,] 4.266981e-03 1.309508e-02 0.982637934