View source: R/random_diagonal_matrix.R
skew_diag_mat | R Documentation |
Creates a diagonal n x n
variance matrix with user-defined skewness
based on a gamma or inverse gamma distribution.
skew_diag_mat(n = 5, shape = 1.5, scale = 1, inverse = FALSE, mean.var = NULL)
n |
A scalar defining the dimensions of the variance matrix. |
shape |
A scalar defining the shape of the distribution. |
scale |
A scalar defining the scale of the distribution. |
inverse |
When |
mean.var |
An optional scalar defining the mean variance. . When supplied, the variances are scaled to achieve the defined mean. |
A diagonal n x n
variance matrix.
# Simulate a random diagonal matrix with 10 columns and rows, and negatively skewed variances
# scaled to a mean of 0.1.
diag_mat <- skew_diag_mat(
n = 10,
shape = 1.5,
scale = 1,
mean.var = 0.1
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.