dirichlet: Dirichlet Functions

Description Usage Arguments Value Examples

Description

pdf and random deviates of the Dirichlet distribution.

Usage

1
2
3
ddirichlet(x, alpha)

rdirichlet(n, alpha, allowZero = FALSE)

Arguments

x

vector of quantiles. For x < 0 || x > 1 or if the sum of x is not equal to 1, zero will be returned for the density

alpha

The Dirichlet parameters. alpha > 0 unless allowZero=TRUE

n

number of observations

allowZero

Indicator that zeros are allowed in the alpha vector and should be handled appropriately

Value

ddirichlet gives the density and rdirichlet generates random deviates.

Examples

1
2
3
4
rdirichlet(10, c(4,3,2))
ddirichlet(c(.2, .7, .1), c(4, 3, 2))
rdirichlet(5, c(4,3,0,2), allowZero=TRUE)
(ddirichlet(c(-0.2, 1.2), c(2,2)) == 0)

bertcarnell/dirichlet documentation built on May 12, 2021, 11:55 p.m.