Learn R Programming

oeli (version 0.7.1)

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

[integer(1)]
The dimension.

df

[integer(1)]
The degrees of freedom of the inverse Wishart distribution greater or equal dim.

scale

[matrix()]
The scale covariance matrix of the inverse Wishart distribution of dimension dim.

diag

[logical(1)]
Diagonal matrix?

See Also

Other matrix helpers: check_correlation_matrix(), check_covariance_matrix(), check_transition_probability_matrix(), cov_to_chol(), diff_cov(), insert_matrix_column(), matrix_diagonal_indices(), matrix_indices(), sample_correlation_matrix(), sample_transition_probability_matrix(), stationary_distribution()

Examples

Run this code
sample_covariance_matrix(dim = 3)

Run the code above in your browser using DataLab