dirichlet: Dirichlet functions

Description Usage Arguments Value Author(s) See Also Examples

Description

pdf and random deviates of the Dirichlet distribution.

Usage

1
2
rdirichlet(n, alpha, allowZero=FALSE)
ddirichlet(x, alpha)

Arguments

alpha

The Dirichlet parameters. alpha > 0 unless allowZero=TRUE

n

number of observations

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

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.

Author(s)

Rob Carnell

See Also

fit.dirichlet

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)

dirichlet documentation built on May 2, 2019, 6:49 p.m.