rudirichlet: Produce random draws from a uniform Dirichlet distribution

Description Usage Arguments Details Value Examples

View source: R/bayesboot.R

Description

rudirichlet produces n draws from a d-dimensional uniform Dirichlet distribution. Here "uniform" implies that any combination of values on the support of the distribution is equally likely, that is, the α parameters to the Dirichlet distribution are all set to 1.0.

Usage

1

Arguments

n

the number of draws.

d

the dimension of the Dirichlet distribution.

Details

In the context of the Bayesian bootstrap rudirichlet is used to produces the bootstrap weights. Therefore, rudirichlet can be used if you directly want to generate Bayesian bootstrap weights.

Value

An n by d matrix.

Examples

1
2
3
4
5
6
7
8
9
set.seed(123)
rudirichlet(2, 3)
# Should produce the following matrix:
#       [,1]   [,2]   [,3]
# [1,] 0.30681 0.2097 0.4834
# [2,] 0.07811 0.1390 0.7829

# The above could be seen as a sample of two Bayesian bootstrap weights for a
# dataset of size three.

rasmusab/bayesboot documentation built on May 27, 2019, 2:03 a.m.