Description Usage Arguments Details Value Author(s) Examples
View source: R/make_compositional.R
Given a covariance matrix, removes multiplicative noise
1 2 | make_compositional_variance(Sigma)
make_compositional_min_var(Sigma)
|
Sigma |
the uncorrected covariance matrix |
The two functions use different
methods. make_compositional_variance
calculates the variance of
compositional data that agrees with Sigma (viewed as a bilinear form)
on compositional vectors. That is, the return value Sigma_c is a
symmetric matrix which satisfies t(u)%*%Sigma_c%*%v=t(u)%*%Sigma%*%v
for any compositional vectors u and v, and also rowSums(Sigma_c)=0
.
The compositionally corrected covariance matrix.
Toby Kenney tkenney@mathstat.dal.ca and Tianshu Huang
1 2 3 4 5 6 7 8 9 10 11 | n<-10
p<-5
X<-rnorm(n*p)
dim(X)<-c(n,p)
Sigma<-t(X)%*%X/(n-1)
SigmaComp<-make_compositional_variance(Sigma)
SigmaCompMin<-make_compositional_min_var(Sigma)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.