sample_covariance_matrix: Sample covariance matrix
Description
This function samples a covariance matrix from an inverse Wishart
distribution.
Usage
sample_covariance_matrix(dim, df = dim, scale = diag(dim), diag = FALSE)
Value
A covariance matrix
.
Arguments
- dim
An integer
, the dimension.
- df
An integer
greater or equal dim
, the degrees of freedom of
the inverse Wishart distribution.
- scale
A covariance matrix
of dimension dim
, the scale matrix of the
inverse Wishart distribution.
- diag
Set to TRUE
for a diagonal matrix.
Examples
Run this codesample_covariance_matrix(dim = 3)
Run the code above in your browser using DataLab