Learn R Programming

oeli (version 0.5.2)

rdirichlet: Draw from Dirichlet distribution

Description

This function draws from a Dirichlet distribution.

Usage

rdirichlet(n = 1, concentration)

Value

If n = 1 a vector of length p, else a matrix of dimension n times p with samples as rows.

Arguments

n

An integer, the number of samples.

concentration

The non-negative concentration vector of length p.

Examples

Run this code
rdirichlet(concentration = 1:3)
rdirichlet(n = 4, concentration = 1:2)

Run the code above in your browser using DataLab