Learn R Programming

matdist (version 0.1.1)

mxDir: Matrix Variate Dirichlet Distributions

Description

We have 2 types of Dirichlet distributions, namely, Type 1 and Type 2. Like other functions, dmxDir1 and dmxDir2 are to evaluate densities, while rmxDir1 and rmxDir2 generate random samples accordingly to the model provided.

Usage

dmxDir1(X, a)

dmxDir2(X, a)

rmxDir1(p, a, S)

rmxDir2(p, a)

Arguments

X

a (p-by-p-by-r) array whose density be computed.

a

weight vector of length r+1.

p

the dimension for sample matrix.

S

a (p-by-p) covariance matrix required for sampling from Wishart.

Examples

Run this code
# NOT RUN {
## Sample Generations
sDir1 = rmxDir1(4,a=c(6,7,8,9),S=diag(4))
sDir2 = rmxDir2(4,a=c(9,8,7,6))

# }

Run the code above in your browser using DataLab