Learn R Programming

LearnBayes (version 2.15.2)

rdirichlet: Random draws from a Dirichlet distribution

Description

Simulates a sample from a Dirichlet distribution

Usage

rdirichlet(n,par)

Value

matrix of simulated draws where each row corresponds to a single draw

Arguments

n

number of simulations required

par

vector of parameters of the Dirichlet distribution

Author

Jim Albert

Examples

Run this code
par=c(2,5,4,10)
n=10
rdirichlet(n,par)

Run the code above in your browser using DataLab