mvgls.pca {mvMORPH} | R Documentation |
Principal Component Analysis (PCA) based on GLS (or OLS) estimate of the traits variance-covariance matrix (possibly regularized)
Description
Performs a principal component analysis (PCA) on a regularized variance-covariance matrix obtained using the mvgls
or the mvols
function. With "evolutionary" models in mvgls
, this performs the so-called phylogenetic PCA.
Usage
mvgls.pca(object, plot=TRUE, ...)
Arguments
object |
A model fit obtained by the |
plot |
Plot of the PC's axes. Default is TRUE (see details).' |
... |
Options to be passed through. (e.g., |
Details
mvgls.pca
allows computing a principal component analysis based on a GLS (or OLS) estimate of the covariance matrix (see mvgls
and mvols
). The phylogenetic PCA (following Revell 2009) is a special case obtained from the (possibly regularized) evolutionary variance-covariance matrix (see also the phyl.pca_pl
function in RPANDA). In the high-dimensional case the contribution of the firsts PC axes tend to be overestimated with traditional maximum likelihood approaches. Penalized/regularized model fit reduce this bias and allow incorporating various residuals structures (see Clavel et al. 2019).
Plotting options, the number of axes to display (axes=c(1,2)
is the default), and whether the covariance (mode="cov"
) or correlation (mode="corr"
) should be used can be specified through the ellipsis "...
" argument.
Value
a list with the following components
scores |
the PC scores |
values |
the eigenvalues of the variance-covariance matrix estimated by mvgls or mvols |
vectors |
the eigenvectors of the variance-covariance matrix estimated by mvgls or mvols |
rank |
the rank of the estimated variance-covariance matrix |
Note
Contrary to conventional PCA (for instance using mvols
with "LL" method), the principal axes of the gls PCA are not orthogonal, they represent the main axes of independent (according to a given phylogenetic or time-series model) evolutionary changes.
Author(s)
J. Clavel
References
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. Systematic Biology 68(1): 93-116.
Revell, L.J., 2009. Size-correction and principal components for intraspecific comparative studies. Evolution, 63:3258-3268.
See Also
Examples
set.seed(1)
n <- 32 # number of species
p <- 30 # number of traits
tree <- pbtree(n=n) # phylogenetic tree
R <- crossprod(matrix(runif(p*p),p)) # a random symmetric matrix (covariance)
# simulate a dataset
Y <- mvSIM(tree, model="BM1", nsim=1, param=list(sigma=R))
# The conventional phylogenetic PCA
phylo_pca <- mvgls(Y~1, tree=tree, model="BM", method="LL")
mvgls.pca(phylo_pca, plot=TRUE)
# fit a multivariate Pagel lambda model with Penalized likelihood
fit <- mvgls(Y~1, tree=tree, model="lambda", method="LOO", penalty="RidgeAlt")
# Perform a regularized phylogenetic PCA using the model fit (Pagel lambda model)
pca_results <- mvgls.pca(fit, plot=TRUE)
# retrieve the scores
head(pca_results$scores)