rdirichlet: Dirichlet distribution

Description Usage Arguments Details Author(s) See Also Examples

Description

Density and random generation for the Dirichlet distribution with mean equal to mean and standard deviation equal to sd.

Usage

1
2
3
4
5
rdirichlet(n, alpha)

rdirichlet1(alpha)

ddirichlet(x, alpha)

Arguments

n

Number of random vectors to generate.

alpha

Vector or (for ddirichlet) matrix containing shape parameters.

x

A vector containing a single random deviate or matrix containg one random deviate per row.

Details

The Dirichlet is the multidimensional of the bet distribution and the canonical Bayesian Distribution for the parameters of a multinomial distribution. rdirichlet1(alpha) is a shortcut for rdirichlet(1, alpha)

Author(s)

Code original posted by Ben Bolker to R-News on Fri Dec 15 2000. See https://stat.ethz.ch/pipermail/r-help/2000-December/009561.html. Ben attributed the code to Ian Wilson i.wilson@maths.abdn.ac.uk. Subsequent modifications by Gregory R. Warnes greg@warnes.net.

See Also

dbeta, rbeta

Examples

1
2
3
4
set.seed(42)
rdirichlet(5, c(1,1,1) )
set.seed(42)
rdirichlet1(c(1,1,1))

KlausVigo/phangornMCMC documentation built on May 23, 2019, 4:23 p.m.