Simulate some allele frequencies using Dirichlet Random variables

simAlleleFreqs(
  nLoci = 10,
  allelesPerLocus = rep(10, nLoci),
  shape = rep(3, nLoci)
)

Arguments

nLoci

\(L\) the number of loci in the multiplex

allelesPerLocus

the number of alleles per locus

shape

the shape parameter

Value

a list with elements locus.\(l\) where \(l=1,\ldots,L\), each of which are vectors of length allelesPerLocus[l], consisting of allele frequencies for that locus

Examples

set.seed(123) simAlleleFreqs()
#> $locus.1 #> [1] 0.05993950 0.16774094 0.01920464 0.09593336 0.21063532 0.11623791 #> [7] 0.03187120 0.01823361 0.17036214 0.10984137 #> #> $locus.2 #> [1] 0.12026035 0.10147530 0.06435365 0.18817940 0.15064315 0.09142126 #> [7] 0.06852002 0.08223674 0.04323072 0.08967941 #> #> $locus.3 #> [1] 0.02422456 0.04435757 0.04558366 0.08987597 0.09146305 0.10233744 #> [7] 0.17657763 0.16498951 0.15364728 0.10694334 #> #> $locus.4 #> [1] 0.13003762 0.04122114 0.09542306 0.09828564 0.20880307 0.04546036 #> [7] 0.13901668 0.05662526 0.10363823 0.08148895 #> #> $locus.5 #> [1] 0.10179292 0.12366911 0.04671933 0.02723483 0.04579138 0.11938481 #> [7] 0.13123516 0.07401534 0.29520368 0.03495342 #> #> $locus.6 #> [1] 0.09864653 0.10705449 0.08490071 0.13701264 0.22312202 0.05860048 #> [7] 0.04200113 0.04941918 0.11743985 0.08180297 #> #> $locus.7 #> [1] 0.03889768 0.05842662 0.10356282 0.12986170 0.08041442 0.05912883 #> [7] 0.12597451 0.18718073 0.13354075 0.08301193 #> #> $locus.8 #> [1] 0.08740722 0.05504890 0.08909454 0.04947388 0.15284444 0.05609853 #> [7] 0.16977977 0.06597136 0.08623347 0.18804791 #> #> $locus.9 #> [1] 0.09375526 0.17233964 0.06207293 0.08897125 0.11960703 0.12461064 #> [7] 0.07871163 0.06127397 0.12183927 0.07681837 #> #> $locus.10 #> [1] 0.09662579 0.08550921 0.07612927 0.04532548 0.12124272 0.11498063 #> [7] 0.09141690 0.08743598 0.10071074 0.18062328 #>