Generates a positive definite and symmetric matrix with specified eigen-values
Posdef(p, ev = rexp(p,1/100))
Arguments
p: The dimension of the matrix
ev: The eigenvalues. If not specified, eigenvalues are taken from an exponential distribution.
Returns
Returns a symmetric positive-definite matrix with eigen-values = ev.
Details
Posdef generates random positive definite covariance matrices with specified eigen-values that can be used to simulate multivariate datasets (see Uyeda et al. 2015 - and supplied R codes).
References
Uyeda J.C., Caetano D.S., Pennell M.W. 2015. Comparative Analysis of Principal Components Can be Misleading. Syst. Biol. 64:677-689.
Clavel, J., Aristide, L., Morlon, H., 2019. A Penalized Likelihood framework for high-dimensional phylogenetic comparative methods and an application to new-world monkeys brain evolution. Syst. Biol. 68:93-116.
Author(s)
J. Clavel
See Also
GIC.fit_pl.rpanda, fit_t_pl
phyl.pca_pl
Examples
if(test){if(require(mvMORPH)){set.seed(123)n <-32# number of speciesp <-40# number of traitstree <- pbtree(n=n)# phylogenetic treeR <- Posdef(p)# a random symmetric matrix (covariance)# simulate a datasetY <- mvSIM(tree, model="BM1", nsim=1, param=list(sigma=R))test <- fit_t_pl(Y, tree, model="BM", method="RidgeAlt")GIC(test)}}