Learn R Programming

countSTAR (version 1.2.0)

rdir: Dirichlet sampler

Description

Compute one Monte Carlo draw from a Dirichlet distribution

Usage

rdir(params)

Value

the vector of the Dirichlet draw on the simplex

Arguments

params

the vector of (nonnegative) Dirichlet parameters

Details

This function computes one draw from a Dirichlet distribution. The output is on a simplex (nonnegative, sum to one) and has the same length as the input params.

Examples

Run this code
# Example draw:
rdir(params = c(1,2,3))

Run the code above in your browser using DataLab