rDir: Random generation for Dirichelt distribution

Description Usage Arguments Value See Also Examples

View source: R/Categorical_Inference.r

Description

Generate random samples from Dirichlet distribution. For a random vector x, the density function is Dirichlet distribution is defined as: 1/Beta(alpha) prod_i=1:p x_i^alpha_i -1 Where Beta() is the beta function. p is the dimension of x.

Usage

1
rDir(n, alpha)

Arguments

n

integer, number of samples.

alpha

numeric, Dirichlet parameter.

Value

A numeric matrix of n rows and length(alpha) columns.

See Also

dDir

Examples

1
rDir(5,c(1,2,3)) #generate 5 samples with parameters c(1,2,3)

bbricks documentation built on July 8, 2020, 7:29 p.m.