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,] 2.834620e-02 7.977581e-01 0.17389571
#>  [2,] 9.329120e-01 1.854465e-04 0.06690251
#>  [3,] 9.208111e-02 6.947831e-03 0.90097105
#>  [4,] 5.875897e-03 8.315553e-01 0.16256884
#>  [5,] 1.761448e-04 8.848907e-06 0.99981501
#>  [6,] 4.244494e-02 1.050434e-02 0.94705072
#>  [7,] 6.597308e-01 1.340890e-03 0.33892826
#>  [8,] 2.472067e-03 2.220340e-01 0.77549396
#>  [9,] 1.589457e-05 3.504001e-02 0.96494410
#> [10,] 3.879569e-01 1.898114e-01 0.42223173