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.19659627 0.09279533 0.71060840 0.36131185 0.29365402 0.2530227023
#>  [2,] 0.26118451 0.34935840 0.38945709 0.18599155 0.31528391 0.1388106205
#>  [3,] 0.19574691 0.19720933 0.60704376 0.04628595 0.09214397 0.5986747401
#>  [4,] 0.01128943 0.94505366 0.04365691 0.20126471 0.00285332 0.6554100994
#>  [5,] 0.20281126 0.49339931 0.30378943 0.62109607 0.05350141 0.0929134871
#>  [6,] 0.32994934 0.14976797 0.52028269 0.30401325 0.24915756 0.0644091625
#>  [7,] 0.39667025 0.51047483 0.09285492 0.14873546 0.15294770 0.6470587154
#>  [8,] 0.18507012 0.63688884 0.17804104 0.40331386 0.30856744 0.1807084857
#>  [9,] 0.62897094 0.12216235 0.24886671 0.37855186 0.04199900 0.0003085087
#> [10,] 0.17173284 0.32763064 0.50063653 0.52546676 0.11518255 0.0246033371
#>             [,7]       [,8]       [,9]
#>  [1,] 0.09201143 0.04447063 0.95552937
#>  [2,] 0.35991391 0.24377161 0.75622839
#>  [3,] 0.26289534 0.56382171 0.43617829
#>  [4,] 0.14047187 0.82946319 0.17053681
#>  [5,] 0.23248903 0.02265407 0.97734593
#>  [6,] 0.38242002 0.19025265 0.80974735
#>  [7,] 0.05125812 0.11459317 0.88540683
#>  [8,] 0.10741021 0.43385001 0.56614999
#>  [9,] 0.57914063 0.38711431 0.61288569
#> [10,] 0.33474735 0.91972516 0.08027484