Description Usage Arguments Value Author(s) Examples

Functions to compute the density of a Dirichlet distribution and to generate random realizations from such a distribution.

1 2 |

`alpha` |
Shape parameter vector. |

`x` |
Vector of the same length as |

`n` |
Number of realizations (vectors) to generate. |

`log` |
Logical value. TRUE if computing the log density. Default is FALSE. |

`rDirichlet`

returns a vector of the same length as `alpha`

if `n`

=1, or a matrix with each row being an independent realization otherwise.

Audrey Q. Fu coded `dDirichlet`

.

The code for `rDirichlet`

is taken from a similar function in R package `gregmisc`

by Gregory R. Warnes. His code was based on code posted by Ben Bolker to R-News on 15 Dec 2000. See documentation in gregmisc for further information.

1 2 | ```
x <- rDirichlet (5, rep (0.5, 3))
dDirichlet (x[1, ], rep (0.5, 3))
``` |

```
[1] 1.247604
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.