rpeIW | R Documentation |
Simulate prior (co)variance matrix according to the inverse Wishart distribution with parameter expansion on the hyperparameters.
rpeIW(n = 1, V, nu, alpha.mu, alpha.V)
n |
Integer of how many samples to generate. |
V |
Numeric matrix of the expected (co)variances |
nu |
Numeric for the degree of belief parameter for the inverse- Wishart. |
alpha.mu |
Numeric vector of means for the redundant working parameters. |
alpha.V |
Numeric matrix of the covariance matrix for the redunant working parameters. |
Details on the meaning of V, nu, alpha.mu, alpha.V
can be found
in the MCMCglmm
documentation covering the way
to specify variance structure priors in the prior
argument.
A numeric vector (if the dimensions of V
are 1) or matrix
where each row designates a sampled (co)variance and the columns contain
the matrix elements for the prior covariance matrix.
MCMCglmm
, rIW
Other prior functions:
dIW()
set.seed(101)
(peIW <- rpeIW(n = 5, V = diag(2), nu = 3,
alpha.mu = rep(0, 2), alpha.V = diag(2)*1000))
sapply(1:5, FUN = function(i){matrix(peIW[i, ], 2, 2)}, simplify = "array")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.