Learn R Programming

drugDemand (version 0.1.3)

rdirichlet: Random Number Generator for the Dirichlet Distribution

Description

Generates cell probabilities from the Dirichlet distribution.

Usage

rdirichlet(n = 1, alpha)

Value

A matrix of n rows and k columns, where n is the number of observations and k is the number of cells.

Arguments

n

The number of observations.

alpha

The shape parameters of the Dirichlet distribution.

Author

Kaifeng Lu, kaifenglu@gmail.com

Examples

Run this code

rdirichlet(2, c(50, 20, 30))

Run the code above in your browser using DataLab