Skip to contents

Sample independently from Dirichlet distributions for each of d_k vectors

Usage

rdirich_dk_vects(nsamp, alpha)

Arguments

nsamp

number of samples to take

alpha

List of vectors of concentration parameters

Value

A matrix with sum(d_k) columns and nsamp rows

Examples

rdirich_dk_vects(10, list(rep(1, 3), rep(1, 4), rep(1, 2)))
#>             [,1]      [,2]       [,3]       [,4]       [,5]         [,6]
#>  [1,] 0.20535040 0.7595615 0.03508807 0.20126471 0.00285332 0.6554100994
#>  [2,] 0.31718216 0.4226124 0.26020543 0.62109607 0.05350141 0.0929134871
#>  [3,] 0.07176754 0.2074761 0.72075637 0.30401325 0.24915756 0.0644091625
#>  [4,] 0.16877859 0.7032930 0.12792838 0.14873546 0.15294770 0.6470587154
#>  [5,] 0.18507012 0.6368888 0.17804104 0.40331386 0.30856744 0.1807084857
#>  [6,] 0.62897094 0.1221624 0.24886671 0.37855186 0.04199900 0.0003085087
#>  [7,] 0.17173284 0.3276306 0.50063653 0.52546676 0.11518255 0.0246033371
#>  [8,] 0.03511602 0.2689116 0.69597242 0.43610865 0.37576666 0.1366471356
#>  [9,] 0.36821220 0.4104749 0.22131290 0.35255273 0.15521903 0.4024583194
#> [10,] 0.22705310 0.6989079 0.07403897 0.05723846 0.37188783 0.1633066699
#>             [,7]       [,8]       [,9]
#>  [1,] 0.14047187 0.82946319 0.17053681
#>  [2,] 0.23248903 0.02265407 0.97734593
#>  [3,] 0.38242002 0.19025265 0.80974735
#>  [4,] 0.05125812 0.11459317 0.88540683
#>  [5,] 0.10741021 0.43385001 0.56614999
#>  [6,] 0.57914063 0.38711431 0.61288569
#>  [7,] 0.33474735 0.91972516 0.08027484
#>  [8,] 0.05147755 0.63318867 0.36681133
#>  [9,] 0.08976992 0.62511716 0.37488284
#> [10,] 0.40756704 0.36088381 0.63911619