Learn R Programming

causaloptim (version 1.0.0)

rdirichlet: Sample from a Dirichlet distribution

Description

Generate a random vector from the k-dimensional symmetric Dirichlet distribution with concentration parameter alpha

Usage

rdirichlet(k, alpha = 1)

Value

a numeric vector

Arguments

k

Length of the vector

alpha

Concentration parameters

Examples

Run this code
qvals <- rdirichlet(16, 1)
sum(qvals)

Run the code above in your browser using DataLab