Learn R Programming

WARDEN (version 0.99.1)

rdirichlet: Draw from a dirichlet distribution based on number of counts in transition. Adapted from brms::rdirichlet

Description

Draw from a dirichlet distribution based on number of counts in transition. Adapted from brms::rdirichlet

Usage

rdirichlet(n = 1, alpha, seed = NULL)

Value

A transition matrix. If n>1, it will return a list of matrices.

Arguments

n

Number of draws (must be >= 1). If n>1, it will return a list of matrices.

alpha

A matrix of alphas (transition counts)

seed

An integer which will be used to set the seed for this draw.

Examples

Run this code
rdirichlet(n=1,alpha= matrix(c(1251, 0, 350, 731),2,2))
rdirichlet(n=2,alpha= matrix(c(1251, 0, 350, 731),2,2))

Run the code above in your browser using DataLab