Learn R Programming

shrinkem (version 0.2.0)

mvF: The matrix F Distribution

Description

Density and random generation for the matrix variate F distribution with first degrees of freedom df1, second degrees of freedom df2, and scale matrix B.

Usage

dmvF(x, df1, df2, B, log = FALSE)

rmvF(n, df1, df2, B)

Value

dmvF returns the probability density of the matrix F distribution. rmvF returns a numeric array, say R, of dimension \(p \times p \times n\), where each element R[,,i] is a positive definite matrix, a realization of the matrix F distribution.

Arguments

x

Positive definite matrix of quantities.

df1

First degrees of freedom

df2

Second degrees of freedom

B

Positive definite scale matrix

log

logical; if TRUE, density is given as log(p).

n

Number of draws

References

Mulder and Pericchi (2018). The Matrix-F Prior for Estimating and Testing Covariance Matrices. Bayesian Analysis, 13(4), 1193-1214. <https://doi.org/10.1214/17-BA1092>

Examples

Run this code

set.seed(20180222)
draws_F <- rmvF(n=1, df1=2, df2=4, B=diag(2))
dmvF(draws_F[,,1], df1=2, df2=4, B=diag(2))

Run the code above in your browser using DataLab