Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

sample_dirichlet

Sample from a Dirichlet distribution


Description

Sample finite-dimensional vectors to use as latent position vectors in random dot product graphs

Usage

sample_dirichlet(n, alpha)

Arguments

n

Integer scalar, the sample size.

alpha

Numeric vector, the vector of alpha parameter for the Dirichlet distribution.

Details

sample_dirichlet generates samples from the Dirichlet distribution with given alpha parameter. The sample is drawn from length(alpha)-1-simplex.

Value

A dim (length of the alpha vector for sample_dirichlet) times n matrix, whose columns are the sample vectors.

See Also

Other latent position vector samplers: sample_sphere_surface(), sample_sphere_volume()

Examples

lpvs.dir    <- sample_dirichlet(n=20, alpha=rep(1, 10))
RDP.graph.2 <- sample_dot_product(lpvs.dir)
colSums(lpvs.dir)

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.