Learn R Programming

maptpx (version 1.9-7)

rdir: Dirichlet RNG

Description

Generate random draws from a Dirichlet distribution

Usage

rdir(n, alpha)

Arguments

n

The number of observations.

alpha

A vector of scale parameters, such that \(E[p_j] = \alpha_j/\sum_i\alpha_i\).

Value

An n column matrix containing the observations.

Examples

Run this code
# NOT RUN {
rdir(3,rep(1,6))
 
# }

Run the code above in your browser using DataLab