Learn R Programming

evolqg (version 0.2-2)

RSProjection: Random Skewers projection

Description

Not tested! Uses MCMC Bayeisian posterior samples of a set of covariance matrices to identify directions of the morphospace in which these matrices differ in their amount of genetic variance.

Usage

RSProjection(cov.matrix.array, p = 0.95, num.vectors = 1000)

Arguments

cov.matrix.array
Array with dimentions traits x traits x populations x MCMCsamples
p
significance treashhold for comparison of variation in each random direction
num.vectors
number of random vectors

Value

  • projection of all matrices in all random vectors

    set of random vectors and confidence intervals for the projections

    eigen decomposition of the random vectors in directions with significant differences of variations #@export

References

Aguirre, J. D., E. Hine, K. McGuigan, and M. W. Blows. "Comparing G: multivariate analysis of genetic variation in multiple populations." Heredity 112, no. 1 (2014): 21-29.

Examples

Run this code
#random set of covariance matrices 
cov.matrices = aperm(aaply(1:15, 1, function(x) 
                     laply(RandomMatrix(10, 100, 
                           variance = runif(10, 1, 10)), 
                           identity)), 
                     c(3, 4, 1, 2))
#rs_proj = evolqg:::RSProjection(cov.matrices, p = 0.8)  
#plot(rs.proj, cov.matrices)

Run the code above in your browser using DataLab