Posdef | R Documentation |
Generates a positive definite and symmetric matrix with specified eigen-values
Posdef(p, ev = rexp(p, 1/100))
p |
The dimension of the matrix |
ev |
The eigenvalues. If not specified, eigenvalues are taken from an exponential distribution. |
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).
Returns a symmetric positive-definite matrix with eigen-values = ev.
J. Clavel
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.
GIC.fit_pl.rpanda
,
fit_t_pl
phyl.pca_pl
if(test){
if(require(mvMORPH)){
set.seed(123)
n <- 32 # number of species
p <- 40 # number of traits
tree <- pbtree(n=n) # phylogenetic tree
R <- Posdef(p) # a random symmetric matrix (covariance)
# simulate a dataset
Y <- mvSIM(tree, model="BM1", nsim=1, param=list(sigma=R))
test <- fit_t_pl(Y, tree, model="BM", method="RidgeAlt")
GIC(test)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.